FormidableLabs / redux-little-router

A tiny router for Redux that lets the URL do the talking.
MIT License
1.04k stars 114 forks source link

"state.router.params" can be undefined (inconsistency) #225

Open jahed opened 7 years ago

jahed commented 7 years ago

I've noticed that if a path is not defined in the routes and you have any code that relies on state.router.params.someParam, it needs to first check if params is defined to safely get it.

This isn't a huge problem as it's easy to workaround, but it's inconsistent with state.router.query which is always defined, even on unknown routes.

Personally, it'd be convenient if params was always there, even as an empty object.

Thoughts?

mikbur commented 6 years ago

I hade a similar problem du to special characters in the url, make shure each part of the url is encodeURIComponent('123=') before addining it to the url