1 import {SKIP_TO_SEARCH_ID} from './src/constants'
2
3 export {default as wrapPageElement} from './src/page'
4 export {default as wrapRootElement} from './src/root'
5
6 export const shouldUpdateScroll = ({routerProps}) => {
7 const {scrollUpdate = true} = routerProps.location.state ?? {}
8 return scrollUpdate
9 }
10
11 export const onRouteUpdate = ({location, prevLocation}) => {
12 if (location.hash === `#${SKIP_TO_SEARCH_ID}` && prevLocation?.hash !== `#${SKIP_TO_SEARCH_ID}`) {
13 document.getElementById(SKIP_TO_SEARCH_ID)?.focus()
14 }
15 }