|
|
@@ -22,11 +22,7 @@ Import the `TLDraw` React component and use it in your app.
|
|
22
|
22
|
import { TLDraw } from '@tldraw/tldraw'
|
|
23
|
23
|
|
|
24
|
24
|
function App() {
|
|
25
|
|
- return (
|
|
26
|
|
- <div>
|
|
27
|
|
- <TLDraw />
|
|
28
|
|
- </div>
|
|
29
|
|
- )
|
|
|
25
|
+ return <TLDraw />
|
|
30
|
26
|
}
|
|
31
|
27
|
```
|
|
32
|
28
|
|
|
|
@@ -38,6 +34,7 @@ The `TLDraw` React component is the [tldraw](https://tldraw.com) editor exported
|
|
38
|
34
|
|
|
39
|
35
|
| Prop | Type | Description |
|
|
40
|
36
|
| --------------- | ------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
|
37
|
+| `id` | `string` | (optional) An id under which to persist the component's state. |
|
|
41
|
38
|
| `document` | `TLDrawDocument` | (optional) An initial [`TLDrawDocument`](#tldrawdocument) object. |
|
|
42
|
39
|
| `currentPageId` | `string` | (optional) A current page id, referencing the `TLDrawDocument` object provided via the `document` prop. |
|
|
43
|
40
|
| `onMount` | `(TLDrawState) => void` | (optional) A callback function that will be called when the editor first mounts, receiving the current `TLDrawState`. |
|