You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

editor.tsx 401B

12345678910111213141516
  1. import { TLDraw } from '@tldraw/tldraw'
  2. import React from 'react'
  3. interface EditorProps {
  4. id?: string
  5. }
  6. export default function Editor({ id = 'home' }: EditorProps) {
  7. const handleMount = React.useCallback((tlstate) => {
  8. // eslint-disable-next-line @typescript-eslint/ban-ts-comment
  9. // @ts-ignore
  10. window.tlstate = tlstate
  11. }, [])
  12. return <TLDraw id={id} onMount={handleMount} />
  13. }