e6a3e5c3ea
* 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
17 lines
442 B
TypeScript
17 lines
442 B
TypeScript
import { Tldraw, TDFile } from '@tldraw/tldraw'
|
|
import * as React from 'react'
|
|
|
|
export default function LoadingFiles(): JSX.Element {
|
|
const [file, setFile] = React.useState<TDFile>()
|
|
|
|
React.useEffect(() => {
|
|
async function loadFile(): Promise<void> {
|
|
const file = await fetch('Example.tldr').then((response) => response.json())
|
|
setFile(file)
|
|
}
|
|
|
|
loadFile()
|
|
}, [])
|
|
|
|
return <Tldraw document={file?.document} />
|
|
}
|