mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-30 02:19:52 +02:00
Replace useMemo with useState in the docs (#5022)
* Replace useMemo with useState * Fix formatting
This commit is contained in:
@@ -17,7 +17,7 @@ const initialValue = [
|
||||
]
|
||||
|
||||
const App = () => {
|
||||
const editor = useMemo(() => withReact(createEditor()), [])
|
||||
const [editor] = useState(() => withReact(createEditor()))
|
||||
|
||||
return (
|
||||
<Slate editor={editor} value={initialValue}>
|
||||
@@ -38,7 +38,7 @@ const initialValue = [
|
||||
]
|
||||
|
||||
const App = () => {
|
||||
const editor = useMemo(() => withReact(createEditor()), [])
|
||||
const [editor] = useState(() => withReact(createEditor()))
|
||||
|
||||
return (
|
||||
<Slate editor={editor} value={initialValue}>
|
||||
@@ -68,7 +68,7 @@ const initialValue = [
|
||||
]
|
||||
|
||||
const App = () => {
|
||||
const editor = useMemo(() => withReact(createEditor()), [])
|
||||
const [editor] = useState(() => withReact(createEditor()))
|
||||
|
||||
return (
|
||||
<Slate editor={editor} value={initialValue}>
|
||||
|
Reference in New Issue
Block a user