-
-
Notifications
You must be signed in to change notification settings - Fork 10.6k
How to handle path="" route #230
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
Comments
<Routes>
<!-- defaults to path="/" -->
<Route name='app' handler={App}>
<!-- is the default handler for `App`, so path="/" -->
<DefaultRoute handler={Home} />
<!-- conflicts with DefaultRoute -->
<Route name='home' path='/' handler={Home} />
<Route name='repo' path='/repo' handler={Repo}/>
</Route>
</Routes> Try this: <Routes>
<Route name='app' handler={App}>
<DefaultRoute handler={Home} />
<Route name='repo' path='/repo' handler={Repo}/>
</Route>
</Routes> |
Let me know if that doesn't work, and I'll reopen. |
I have already try this before if use
will get these warning
|
Oh, right, either remove the name from "app" or add the path "/" to it.
|
I change my route to this
It's very strange ,when i call |
Yeah, I get the same warning.
The only ones that work are |
Try this: React.renderComponent(
<Routes>
<Route handler={App}>
<DefaultRoute handler={Anything} />
<Route path="/foo" handler={Anything} />
</Route>
<Route path="*" handler={NotFound}/>
</Routes>,
document.getElementById('app')
); |
Yep, I tried the path="*" thing too. The path="*" is only matching when its /#/something instead of just /#something... Basically it looks like like / after the hash is required for any route to match, otherwise we get the warning and no component rendered. |
The only way this can happen is if the user types in that url. We should
|
Can someone edit the title of this issue to fix the |
For what it's worth, this can also easily happen if some |
Does it will release in version 0.5.4 ? |
yeah, today or tomorrow, soon as I can document some of the other changes |
OK, Thanks. |
I use the router like this
When i call
http://127.0.0.1:3000/#
without/
after#
will get some warning like thisNo route matches path "". Make sure you have <Route path=""> somewhere in your routes
How can i handle this . I see you guys talking about #221 #140 , I want to ask how can i handle this for now ?
The text was updated successfully, but these errors were encountered: