tldraw/examples/tldraw-example/src/changing-id.tsx
Steve Ruiz e6a3e5c3ea
[big chore] restore core to monorepo (#287)
* move core into repo, apps into apps folder, update tests

* Update scripts for build:core

* improve scripts

* remove noise from www

* Update .gitignore

* Fix focus bug

* add ci test script

* Update main.yml
2021-11-18 13:09:18 +00: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} />
}