1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-13 10:44:02 +02:00

Fix: ESlint Error (#3688)

Value is defined in the upper scope
This commit is contained in:
Ali Muqaddas
2020-05-17 20:51:07 +05:00
committed by GitHub
parent c00f246c7e
commit 9834fe4e95

View File

@@ -70,7 +70,7 @@ const App = () => {
const [value, setValue] = useState([]) const [value, setValue] = useState([])
// Render the Slate context. // Render the Slate context.
return ( return (
<Slate editor={editor} value={value} onChange={value => setValue(value)} /> <Slate editor={editor} value={value} onChange={newValue => setValue(newValue)} />
) )
} }
``` ```
@@ -89,7 +89,7 @@ const App = () => {
const [value, setValue] = useState([]) const [value, setValue] = useState([])
return ( return (
// Add the editable component inside the context. // Add the editable component inside the context.
<Slate editor={editor} value={value} onChange={value => setValue(value)}> <Slate editor={editor} value={value} onChange={newValue => setValue(newValue)}>
<Editable /> <Editable />
</Slate> </Slate>
) )
@@ -114,7 +114,7 @@ const App = () => {
]) ])
return ( return (
<Slate editor={editor} value={value} onChange={value => setValue(value)}> <Slate editor={editor} value={value} onChange={newValue => setValue(newValue)}>
<Editable /> <Editable />
</Slate> </Slate>
) )