tldraw/packages/www/components/editor.tsx
2021-09-06 14:04:32 +01:00

16 lines
401 B
TypeScript

import { TLDraw } from '@tldraw/tldraw'
import React from 'react'
interface EditorProps {
id?: string
}
export default function Editor({ id = 'home' }: EditorProps) {
const handleMount = React.useCallback((tlstate) => {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
window.tlstate = tlstate
}, [])
return <TLDraw id={id} onMount={handleMount} />
}