Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
manzt committed Jul 14, 2024
1 parent af980b2 commit f0cda9a
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,16 @@ export function createViewer(element: HTMLElement): Promise<VizarrViewer> {
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);
Expand Down

0 comments on commit f0cda9a

Please sign in to comment.