mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-22 15:02:51 +02:00
Replace useMemo with useState in the docs (#5022)
* Replace useMemo with useState * Fix formatting
This commit is contained in:
@@ -19,7 +19,7 @@ const initialValue = [
|
||||
]
|
||||
|
||||
const App = () => {
|
||||
const editor = useMemo(() => withReact(createEditor()), [])
|
||||
const [editor] = useState(() => withReact(createEditor()))
|
||||
|
||||
const renderElement = useCallback(props => {
|
||||
switch (props.element.type) {
|
||||
@@ -126,7 +126,7 @@ const initialValue = [
|
||||
]
|
||||
|
||||
const App = () => {
|
||||
const editor = useMemo(() => withReact(createEditor()), [])
|
||||
const [editor] = useState(() => withReact(createEditor()))
|
||||
|
||||
const renderElement = useCallback(props => {
|
||||
switch (props.element.type) {
|
||||
@@ -183,7 +183,7 @@ const initialValue = [
|
||||
]
|
||||
|
||||
const App = () => {
|
||||
const editor = useMemo(() => withReact(createEditor()), [])
|
||||
const [editor] = useState(() => withReact(createEditor()))
|
||||
|
||||
const renderElement = useCallback(props => {
|
||||
switch (props.element.type) {
|
||||
|
Reference in New Issue
Block a user