pokedex icon indicating copy to clipboard operation
pokedex copied to clipboard

withRouter missing

Open skimming opened this issue 9 years ago • 3 comments

Couldn't get the routing from PokemonPreviewPage back to ListPage. Kept complaining about this.props.router being null. Solved via wrapping ala <Route ... component={withRouter(PokemonPage)}.

skimming avatar Nov 15 '16 22:11 skimming

Aw man. Problems around router are clearly the most reported issues. It's on my list but can't look into it right now.

marktani avatar Nov 16 '16 15:11 marktani

Stumbled on this as well, is this a limitation with react-router-relay?

It seemed like routing never worked while going through all the steps, but I ignored until step-7 when I started to investigate and noticed the routing went from this.props.router in the branches to this.context.router in the solutions.

bdougie avatar Dec 20 '16 21:12 bdougie

Ah total misread your issue @skimming. Wrapping withRouter is more ideal than using this.context.

bdougie avatar Dec 20 '16 21:12 bdougie