tldraw/packages/dev/src/changing-id.tsx
2021-09-09 13:32:08 +01:00

14 lines
328 B
TypeScript

import * as React from 'react'
import { TLDraw } from '@tldraw/tldraw'
export default function ChangingId() {
const [id, setId] = React.useState('example')
React.useEffect(() => {
const timeout = setTimeout(() => setId('example2'), 2000)
return () => clearTimeout(timeout)
}, [])
return <TLDraw id={id} />
}