acdlite / redux-router

Redux bindings for React Router – keep your router state inside your Redux store
MIT License
2.3k stars 216 forks source link

Remove warnings on initial render when using async/dynamic routes #202

Closed feychenie closed 8 years ago

feychenie commented 8 years ago

When using dynamic/async routing (https://github.com/rackt/react-router/blob/master/docs/guides/advanced/DynamicRouting.md), warnings are issued on first render :

screen shot 2015-12-02 at 12 46 02

The render method of ReduxRoutingContext has been updated to avoid rendering the original RoutingContext if 'location' is not defined, exactly as it's done in the original Router component from react-router

feychenie commented 8 years ago

This should fix #67, #130 and maybe #66

Scarysize commented 8 years ago

@feychenie Wow thanks for the PR. Could you update let to const and the equality operator (==) to the identity operator (===). I able to merge then.

feychenie commented 8 years ago

and done !

Scarysize commented 8 years ago

Perfect!

feychenie commented 8 years ago

Could you please update the npm package, so we can benefit from this fix ?

Scarysize commented 8 years ago

@feychenie I will collect up some other PRs before republishing to npmjs sorry.