Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Not Found match does not working with Nesting Route #490

Open
@iamyoki

Description

@iamyoki

Fallback not found route is a little bit confused withnest.

Example

<Switch><Routepath="/"nest><AppPage><Routepath="/posts"><PostsView/></Route><Routepath="/posts/:postId"><PostDetailView/></Route></AppPage></Route><Routepath="/auth"><AuthPage/></Route><Route><NotFound/></Route></Switch>
  • '/' represents app page,<AppPage/> wraps nested views.
  • '/auth' represents unauthorized page,<AuthPage/> contains login form.
  • The last route fallback to a not found page (globally)

Unexpected

  • '/some-path-not-exist' didn't reach the not found page route
  • The nest '/' route caught every non-existing paths instead, even the path is not existing inside nesting.

Expected

  • Whethernest prop true of false, should maintain the same expectations
  • '/some-path-not-exist' path should match the fallback route -<NotFound /> if it's not being strictly matched inside nesting routes.

Suggestions

For example

<Switch><Routepath="/"nest><Routepath="settings"nest><SettingsView><Switch><Routepath="appearance"><AppearanceView/></Route><Route>Not found - You may checkout /settings/appearance</Route></Switch></SettingsView></Route></Route><Route><NotFound/></Route></Switch>;

Would be better:

  • Match inside not found if '/settings/some-path-not-exist'
  • Match outside not found if '/some-path-not-exist'
  • '/settings/language' fallbacks to inside not found (<Route>Not found - You may checkout /settings/appearance</Route>)
  • '/set' fallbacks to outside

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp