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

docs: Fix installing slate to pass prettier

This commit is contained in:
Sunny Hirai
2021-07-08 22:51:10 -07:00
parent acfcd9aaf6
commit c3c3670c8b

View File

@@ -65,12 +65,17 @@ declare module 'slate' {
} }
} }
``` ```
```typescript jsx ```typescript jsx
// Also you must annotate `useState<Descendant[]>` and the editor's initial value. // Also you must annotate `useState<Descendant[]>` and the editor's initial value.
const App = () => { const App = () => {
const initialValue : CustomElement = []; const initialValue: CustomElement = []
const [value, setValue] = useState<Descendant[]>(initialValue) const [value, setValue] = useState<Descendant[]>(initialValue)
return <Slate value={value} onChange={setValue}>...</Slate> return (
<Slate value={value} onChange={setValue}>
...
</Slate>
)
} }
``` ```