react-router-native icon indicating copy to clipboard operation
react-router-native copied to clipboard

Router not passed to children

Open VinceBT opened this issue 8 years ago • 3 comments

Hi, I'm using your package for an hybrid app working on both browser and mobile and I've discovered that this.props.router is undefined when on mobile when calling console.log(this.props) in the render method of a Route : Using ReactRouter

image

Using ReactRouterNative

image

I've fixed the problem temporarily by using withRouter.

I'm using nativeHistory on mobile and browserHistory on browser

VinceBT avatar Dec 10 '16 17:12 VinceBT

@VinceBT I am having the same issue. could you please share how did you manage to overcome it?

petromoldovan avatar May 15 '17 12:05 petromoldovan

I've used the withRouter function if I can remember. You call it and get the router I think. I've stopped using their package since they don't want to fix these kind of essential issues.

VinceBT avatar May 15 '17 18:05 VinceBT

@VinceBT thank you!

petromoldovan avatar May 15 '17 20:05 petromoldovan