mirror of
https://github.com/jxnblk/mdx-deck.git
synced 2024-11-04 05:53:39 +03:00
Fix pathname when slide deck not in root
This commit is contained in:
parent
fc36f61881
commit
117e779388
@ -38,8 +38,9 @@ export default props => {
|
||||
}, [index])
|
||||
|
||||
React.useEffect(() => {
|
||||
if (props.location.pathname === '/print') return
|
||||
props.navigate('/#' + index, {
|
||||
const pathname = props.location.pathname
|
||||
if (pathname === '/print') return
|
||||
props.navigate(`${pathname}#${index}`, {
|
||||
replace: true,
|
||||
})
|
||||
}, [index])
|
||||
|
Loading…
Reference in New Issue
Block a user