message: docs: Scroll to top on page change
diff: // Import all themes up front so CSS overrides work
  import * as themes from '../../../lib/themes';
  -import React, { StrictMode } from 'react';
  +import React, { StrictMode, useEffect } from 'react';
  import { Route } from 'react-router';
  +import { useLocation } from 'react-router-dom';
  import { CSSTransition } from 'react-transition-group';
  import '../../../lib/reset';
  @@ -20,7 +21,22 @@ const routes = [
  },
  ];
  -export const App = () => (
  +export const App = () => {
  + const { pathname } = useLocation();
  +
  + useEffect(() => {
  + if ('scrollBehavior' in window.document.documentElement.style) {
  + window.scrollTo({
  + top: 0,
  + left: 0,
  + behavior: 'smooth',
  + });
  + } else {
  + window.scrollTo(0, 0);
  + }
  + }, [pathname]);
  +
  + return (
  <BraidProvider theme={themes.wireframe}>
  <div>
  {routes.map(({ path, exact, Component }) => (
  @@ -33,7 +49,10 @@ export const App = () => (
  unmountOnExit
  >
  <StrictMode>
  - <Box position="absolute" className={styles.transitionContainer}>
  + <Box
  + position="absolute"
  + className={styles.transitionContainer}
  + >
  <Component />
  </Box>
  </StrictMode>
  @@ -44,3 +63,4 @@ export const App = () => (
  </div>
  </BraidProvider>
  );
  +};
  