text: import React, { useEffect, useRef } from 'react';
  
  import { mount } from 'space/SpaceApp';
  import { useHistory } from 'react-router-dom';
  
  export default () => {
    const ref = useRef(null);
    const history = useHistory();
  
    useEffect(() => {
      const { onParentNavigate } = mount(ref.current, {
        initialPath: history.location.pathname,
        onNavigate: ({ pathname: nextPathname }) => {
          const { pathname } = history.location;
  
          if (pathname !== nextPathname) {
            history.push(nextPathname);
          }
        },
      });
  
      history.listen(onParentNavigate);
    }, []);
  
    return <div ref={ref} />;
  };
  