From 05149aacc84fe3291b3c04483affb58cbc0a42a7 Mon Sep 17 00:00:00 2001 From: Steve Ruiz Date: Mon, 6 Sep 2021 14:04:32 +0100 Subject: [PATCH] Add tlstate to window in editor --- packages/www/components/editor.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/www/components/editor.tsx b/packages/www/components/editor.tsx index 73c840bda..949519cf2 100644 --- a/packages/www/components/editor.tsx +++ b/packages/www/components/editor.tsx @@ -1,9 +1,16 @@ import { TLDraw } from '@tldraw/tldraw' +import React from 'react' interface EditorProps { id?: string } export default function Editor({ id = 'home' }: EditorProps) { - return + const handleMount = React.useCallback((tlstate) => { + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + window.tlstate = tlstate + }, []) + + return }