kitze / mobx-router

A simple router for MobX + React apps
509 stars 66 forks source link

Catchall/Not found #15

Closed peterbe closed 4 years ago

peterbe commented 7 years ago

How should you best implement a notfound route?

VolCh commented 7 years ago

Director has 'notfound' in configure options, but mobx-router use only one ('html5history') of them and it hardcoded in createDirectorRouter. I think the simplest way - add options param in createDirectorRouter & startRouter functions and path it to director.configure. It also should resolve https://github.com/kitze/mobx-router/issues/7 issue

ilyanoskov commented 6 years ago

Is there a simpler way now?

thdk commented 4 years ago

Exposed the director configuration object as third argument of the startRoutermethod so you can now use the notfound callback. I've added an example to the readme.

Released in version 0.3.0