mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-09-03 12:12:39 +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
|
```typescript
|
||||||
// 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 (
|
return (
|
||||||
<Slate value={value} onChange={setValue}>
|
<Slate value={value} onChange={setValue}>
|
||||||
|
Reference in New Issue
Block a user