diff --git a/superglue/lib/components/Navigation.tsx b/superglue/lib/components/Navigation.tsx index ee249517..0ae1bd73 100644 --- a/superglue/lib/components/Navigation.tsx +++ b/superglue/lib/components/Navigation.tsx @@ -46,7 +46,7 @@ const notFound = (identifier: string | undefined): never => { const NavigationProvider = forwardRef(function NavigationProvider( { history, visit, remote, mapping }: NavigationProviderProps, - ref: ForwardedRef<{ navigateTo: NavigateTo }> + ref: ForwardedRef<{ navigateTo: NavigateTo | null }> ) { const dispatch = useDispatch() const pages = useSelector((state) => state.pages) diff --git a/superglue/lib/index.tsx b/superglue/lib/index.tsx index 7773de89..2a3f561e 100644 --- a/superglue/lib/index.tsx +++ b/superglue/lib/index.tsx @@ -127,7 +127,7 @@ function Application({ mapping, ...rest }: ApplicationProps) { - const navigatorRef = useRef<{ navigateTo: NavigateTo }>(null) + const navigatorRef = useRef<{ navigateTo: NavigateTo | null }>(null) const { visit, remote, nextHistory, initialPageKey, ujs } = useMemo(() => { return setup({ diff --git a/superglue/lib/types/index.ts b/superglue/lib/types/index.ts index 5accf95a..d24afbfd 100644 --- a/superglue/lib/types/index.ts +++ b/superglue/lib/types/index.ts @@ -461,7 +461,7 @@ export interface BuildStore { */ export interface BuildVisitAndRemote { ( - navigatorRef: React.RefObject<{ navigateTo: NavigateTo }>, + navigatorRef: React.RefObject<{ navigateTo: NavigateTo | null }>, store: SuperglueStore ): { visit: ApplicationVisit @@ -506,7 +506,7 @@ export interface SetupProps { * A ref object created from the Application component that will be passed to buildVisitAndRemote */ navigatorRef: React.RefObject<{ - navigateTo: NavigateTo + navigateTo: NavigateTo | null }> }