preact-router
preact-router copied to clipboard
Props of Router component children are being erased
Right now I'm running into a strange situation where the Router component will erase props on child components. For example, I have a Slides component that is the only child of Router:
render(){
return (
<Router>
<Slides path="/:slide?" slide="1" default />
</Router>
);
}
Inside of the slide component, this.props.slide is always an empty string, no matter what I set it to. If I remove the Router component around the Slides component, this.props.slide populates properly.
Some pertinent version info: preact 8.1.0 preact-router 2.5.2 webpack 2.4.1
Currently using the babel-plugin-transform-react-jsx plugin to parse JSX. Are there any reasons why this would occur? I feel like it's a bug.
Thanks!
Ah - that's interesting. Router is definitely always overriding that property value.
Interestingly, it only happens if you include ? in the route.