storybook/docs/gatsby-browser.js

10 lines
210 B
JavaScript
Raw Normal View History

const { document } = require('global');
2017-06-03 21:03:48 +02:00
exports.onRouteUpdate = location => {
if (location.hash) {
setTimeout(() => {
document.querySelector(`${location.hash}`).scrollIntoView();
}, 0);
}
};