Skip to content

Commit

Permalink
Fixed resource viewer not setting scr ref
Browse files Browse the repository at this point in the history
  • Loading branch information
tjcouch-sil committed Apr 18, 2024
1 parent 9d5b8b9 commit 2efce0c
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
Editor,
EditorRef,
Usj,
getViewOptions,
usjToUsxString,
usxStringToUsj,
} from '@biblionexus-foundation/platform-editor';
Expand Down Expand Up @@ -46,12 +47,15 @@ globalThis.webViewComponent = function ResourceViewer({
if (usx) editorRef.current?.setUsj(usxStringToUsj(usx));
}, [usx]);

const viewOptions = useMemo(() => getViewOptions('formatted'), []);

return (
<Editor
ref={editorRef}
scrRef={scrRef}
setScrRef={setScrRef}
onChange={onChange}
viewOptions={viewOptions}
logger={logger}
/>
);
Expand Down

0 comments on commit 2efce0c

Please sign in to comment.