import * as React from 'react' ; import { useDocViewerStore } from "../DocViewerStore" ; import { useSidenavDocumentChangeCallback } from "./UseSidenavDocumentChangeCallbackHook" ; import { Functions } from 'polar-shared/src/util/Functions' ; export const ResizeOnSidenavDocumentChange = ( ) => { const { resizer } = useDocViewerStore ( [ 'resizer' ] ) ; const handleResize = React . useCallback ( ( ) => { if ( resizer ) { Functions . withTimeout ( ( ) => resizer ( ) ) ; } } , [ resizer ] ) ; useSidenavDocumentChangeCallback ( handleResize ) ; return null ; } ;