1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-04-21 13:51:59 +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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -70,7 +70,7 @@ const App = () => {
const [value, setValue] = useState([])
// Render the Slate context.
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([])
return (
// 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 />
</Slate>
)
@ -114,7 +114,7 @@ const App = () => {
])
return (
<Slate editor={editor} value={value} onChange={value => setValue(value)}>
<Slate editor={editor} value={value} onChange={newValue => setValue(newValue)}>
<Editable />
</Slate>
)