({children}: {children: React.ReactNode})
| 93 | } |
| 94 | |
| 95 | export function NavigationSuspense({children}: {children: React.ReactNode}) { |
| 96 | let {isLoading} = useContext(RouterContext)!; |
| 97 | |
| 98 | useLayoutEffect(() => { |
| 99 | // Scroll to the top when we show the skeleton on mobile. |
| 100 | if (isLoading) { |
| 101 | window.scrollTo({top: 0}); |
| 102 | } |
| 103 | }, [isLoading]); |
| 104 | |
| 105 | return isLoading ? <PageSkeleton /> : children; |
| 106 | } |
| 107 | |
| 108 | interface RouterContextValue { |
| 109 | currentPage: Page; |
nothing calls this directly
no outgoing calls
no test coverage detected