acdlite / redux-router

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

Need to check undefined location prop for async as well as null #220

Closed mjrussell closed 8 years ago

mjrussell commented 8 years ago

Fully finishing the work done in #202

react-router is able to just check null because it checks against its initial state, but the prop unpacking using spread syntax will make the location set to undefined in ReduxRouterContext

Noticed that @yesmeck pointed this out

Scarysize commented 8 years ago

Maybe see if we can come up with a test for this.

mjrussell commented 8 years ago

@Scarysize Yeah I wanted a decent test but the only thing I could think of was to export the ReduxRouterContext component and just test if the location prop is undefined or null that it renders null.

It seemed a little gimmicky, but I could definitely make that. I wonder if its just better to have 2 examples in the repo, one for regular routes and one for async, lazy loading routes (even though its really just following react-router's API.

Scarysize commented 8 years ago

Yeah, okay examples seem to be a good way to display what this changes makes possible.