Skip to content

Instantly share code, notes, and snippets.

View arumals's full-sized avatar

Arturo Maltos arumals

View GitHub Profile
@Katerina198b
Katerina198b / simple-draft.js
Last active December 21, 2021 10:01
Simple draft js and hooks example
import React, {useState} from 'react';
import {Editor, EditorState} from 'draft-js';
const SimpleEditorExample = () => {
const [editorState, setEditorState] = useState(EditorState.createEmpty());
return (
<Editor
editorState={editorState}
onChange={setEditorState}
/>