-
-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
<Link to=".."> and <IndexLink to=".."> don't generate href's under gulp dev server, browserHistory and ES6 #3555
Comments
Are you passing a history instance into Router? |
Thanks @timdorr Do you mean something like this? Then yes
Thanks |
Routes are working themselves, if I enter say |
We don't support relative links right now. See #2172. |
@taion Thanks. But even Thanks. |
The problem might be related to the fact that I want these links in the Header component which is out of RouterContext, i.e.
If possible, could you please point me in the right direction how can I provide this RouterContex to the header? Thanks |
@dariuspranskus any luck on this? I'm having a similar issue. |
It's some months later but this could be useful for someone. @Tmassery the problem was exactly what @dariuspranskus suggested: "The problem might be related to the fact that I want these links in the Header component which is out of RouterContext". When Link is declared outside of Router it renders to an html a tag without href property. import things from somewhere
export default class Routes extends Component {
render() {
return (
<Router history={ browserHistory }>
<Route path='/' component={ App }>
<IndexRoute component={ Home } />
<Route path='about' component={ About } />
</Route>
</Router>
);
}
} Where App is something like this: import things from somewhere
export default class App extends React.Component {
render() {
return (
<div className='app-container'>
<Header />
{this.props.children}
<Footer />
</div>
);
}
} This example was made using react-router 3. It won't work using react-router 4, without modifications. |
Hi
I have a problem with react-router's Link and IndexLink tags not generating href's for the links under gulp dev server, browserHistory enabled and ES6
as a result I get something like this
<a>Home</a>
- no href.my render code is
my routes
my gulp connect task
What could be a problem. Many thanks
Version
2.0.0
Test Case
http://jsbin.com/sacerobuxi/edit?html,js,output
Steps to reproduce
Expected Behavior
Actual Behavior
The text was updated successfully, but these errors were encountered: