STRML / react-router-component

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

Underlines in route break will the Router #151

Closed nodegin closed 9 years ago

nodegin commented 9 years ago
<Location path="/:test_prop" handler={MyComp} />

[Error: React-router-component: No route matched! Did you define a NotFound route?]
nodegin commented 9 years ago

In addition, is there any support for optional parameter? just like

<Location path="/:prop1/:prop2?" handler={MyComp} />

thanks!

jsg2021 commented 9 years ago

The default optional parameter format is to wrap it in ()

<Location path="/:prop1(/:prop2)" handler={MyComp} />

the default url pattern compiler will need to be tweaked for the underscore characters.

jsg2021 commented 9 years ago

See these docs: http://strml.viewdocs.io/react-router-component/override-url-pattern/

https://www.npmjs.com/package/url-pattern

nodegin commented 9 years ago

@jsg2021 thanks a lot

STRML commented 9 years ago

Thanks for handling this @jsg2021

jsg2021 commented 9 years ago

no problem :)