STRML / react-router-component

Declarative router component for React.
http://strml.viewdocs.io/react-router-component
MIT License
874 stars 94 forks source link

Question: Should the router have a callback to filter variable values from routes? #189

Closed jsg2021 closed 7 years ago

jsg2021 commented 7 years ago

Say you have an encoded id in a route, beyond url-encoded... and you have a decode function, but you're calling it every where you pass that id... maybe we could handle it before it leaves the router?

jsg2021 commented 7 years ago

Looks like this may be something that can be passed to the url-pattern config...

jsg2021 commented 7 years ago

The url-pattern object couldn't directly support this, but I found that we can use the same options object to add our own filter.