Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用@reach/router嵌套路由的问题 #1109

Open
huangxinxia opened this issue Jul 29, 2019 · 1 comment
Open

使用@reach/router嵌套路由的问题 #1109

huangxinxia opened this issue Jul 29, 2019 · 1 comment

Comments

@huangxinxia
Copy link

huangxinxia commented Jul 29, 2019

const Home = () => (
  <div>
    <h2>Dashboard</h2>
    <nav>
      <span onClick={() => navigate('/home/bizSetLog')}>team</span>
      <span onClick={() => navigate('/home/bizSetOrgGroup')}>projects</span>
    </nav>
    <Router>
      <ServiceLog path="bizSetLog/*" />
      <GroupSet path="bizSetOrgGroup/*" />
    </Router>
  </div>
);
const ServiceLog = () => (
  <div>
    <Router>
      <Index11 path="/" />
    </Router>
  </div>
);
const GroupSet = () => (
  <div>
    <Router>
      <Index22 path="/" />
    </Router>
  </div>
);
const Index11 = () => (1111);
const Index22 = () => (2222);
ReactDOM.render(
  <div>
    <div>
      <Link to="home">---home---</Link>
    </div>
    <Router>
      <Home path="home/*" />
    </Router>
  </div>,
  document.getElementById('root'),
);
@huangxinxia
Copy link
Author

这是一个很简单的3层嵌套的路由,从/home/bizSetLog切换到/home/bizSetOrgGroup,Index22 这个组件不显示。
我换成react,是可以正常切换的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant