From f0cda9aacbe9e845d334f2619c3e6fcb4f018ce6 Mon Sep 17 00:00:00 2001 From: Trevor Manz Date: Sun, 14 Jul 2024 16:09:36 -0700 Subject: [PATCH] formatting --- src/index.tsx | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/index.tsx b/src/index.tsx index 0c7703c..3651ea8 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -50,12 +50,16 @@ export function createViewer(element: HTMLElement): Promise { function App() { const addImage = useSetAtom(addImageAtom); const setViewState = useSetAtom(viewStateAtom); - React.useImperativeHandle(ref, () => ({ - addImage, - setViewState, - on: emitter.on, - destroy: () => root.unmount() - }), []); + React.useImperativeHandle( + ref, + () => ({ + addImage, + setViewState, + on: emitter.on, + destroy: () => root.unmount(), + }), + [] + ); React.useEffect(() => { if (ref.current) { resolve(ref.current);