parcel-preact-draftjs

ref: master

src/app.js


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
import { h } from 'preact';
import { Editor, EditorState } from 'draft-js';
import 'draft-js/dist/Draft.css';

const App = () => {
  const [editorState, setEditorState] = useState(() =>
    EditorState.createEmpty()
  );

  return (
    <div className="">
      Hello

      <Editor
        editorState={editorState}
        onChange={setEditorState} />
    </div>
  );
}

export default App;