1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-31 02:49:56 +02:00

Fix code sample (#4558)

It's an array of CutsomElement, TS complains about it
This commit is contained in:
Hadrien
2021-09-29 15:08:09 +02:00
committed by GitHub
parent b108491820
commit 81cb2ae659

View File

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