tldraw/packages/www/components/editor.tsx
Steve Ruiz bbee7bc2b2
Feature copy and paste (#99)
* adds copy and paste, scopes keyboard events to focused elements

* Fix tools panel bug, adds copy across documents

* Makes autofocus default
2021-09-21 16:47:04 +01:00

20 lines
463 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 (
<div className="tldraw">
<TLDraw id={id} onMount={handleMount} autofocus />
</div>
)
}