Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const hashtagPluginInstance = hashtagPlugin({ Hashtag });
const linkifyPluginInstance = linkifyPlugin({ Link });
const historyPluginInstance = historyPlugin();
const { UndoButton, RedoButton } = historyPluginInstance;
const { StickerSelect } = stickerPluginInstance;
const plugins = [
hashtagPluginInstance,
stickerPluginInstance,
linkifyPluginInstance,
];
export default class UnicornEditor extends Component {
state = {
editorState: createWithText('Hello World!', plugins),
showState: false,
};
onChange = (editorState) => {
this.setState({
editorState,
});
};
focus = () => {
this.refs.editor.focus();
};
undo = () => {
this.setState({
editorState: EditorState.undo(this.state.editorState),