tldraw/packages/dev/src/changing-id.tsx

15 lines
328 B
TypeScript
Raw Normal View History

2021-09-08 10:16:10 +00:00
import * as React from 'react'
import { TLDraw } from '@tldraw/tldraw'
2021-09-09 12:32:08 +00:00
export default function ChangingId() {
2021-09-08 10:16:10 +00:00
const [id, setId] = React.useState('example')
React.useEffect(() => {
const timeout = setTimeout(() => setId('example2'), 2000)
return () => clearTimeout(timeout)
}, [])
return <TLDraw id={id} />
}