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:
@@ -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}>
|
||||
|
Reference in New Issue
Block a user