Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: cant start route with @ within Layout Routes (#8699) #8700

Closed
wants to merge 20 commits into from
Closed

Fix: cant start route with @ within Layout Routes (#8699) #8700

wants to merge 20 commits into from

Conversation

theostavrides
Copy link
Contributor

@theostavrides theostavrides commented Mar 4, 2022

Fixes bug #8699

When a route is nested within a layout route, it wont render routes starting with an '@' symbol:

<Routes>
    <Route element={<Layout />}>
        <Route path=":id" element={<Chat />} />
    </Route>
</Routes>

Note that the router works correctly when the parent is NOT a layout route (i.e. has a path defined), or is at the root level:

    <Router>
      <Routes>
        <Route path=":id" element={'works with /@tom'}/>
        <Route path="nested">
          <Route path=":id" element={'works with /nested/@tom'}/>
        </Route>
      </Routes>
    </Router>

@remix-cla-bot
Copy link
Contributor

remix-cla-bot bot commented Mar 4, 2022

Hi @theostavrides,

Welcome, and thank you for contributing to React Router!

Before we consider your pull request, we ask that you sign our Contributor License Agreement (CLA). We require this only once.

You may review the CLA and sign it by adding your name to contributors.yml.

Once the CLA is signed, the CLA Signed label will be added to the pull request.

If you have already signed the CLA and received this response in error, or if you have any questions, please contact us at hello@remix.run.

Thanks!

- The Remix team

@remix-cla-bot
Copy link
Contributor

remix-cla-bot bot commented Mar 4, 2022

Thank you for signing the Contributor License Agreement. Let's get this merged! 🥳

@knpwrs
Copy link
Contributor

knpwrs commented Mar 8, 2022

This would also fix remix-run/remix#2012

@kgamecarter
Copy link

also fix remix-run/remix#846

@chaance
Copy link
Collaborator

chaance commented Apr 19, 2022

@theostavrides I'd love to merge this. Would you mind resolving the merge conflicts and updating your branch?

It's actually simple, we just reorganized our file structure a bit and the updated code is now in react-router/lib/router.ts. Thanks a ton!

@theostavrides
Copy link
Contributor Author

@chaance Would be happy to. I'll get on it tomorrow

tkindy and others added 16 commits April 23, 2022 22:43
* docs: Remove misplaced `npm install`

I think this line was originally meant to be in the "Install React Router v6" call, but there's already an `npm install` command shown there.

* Sign CLA

* Update reach.md

Co-authored-by: Tim Dorr <timdorr@users.noreply.github.com>
* Add Backwards Compatibility info to v5 Migration Doc

* Fix path

* Update contributers

* Update phrasing

* Update docs/upgrading/v5.md

Co-authored-by: Tim Dorr <timdorr@users.noreply.github.com>
* Fix some typos in docs

* Sign CLA
* fix: highlight code diff for invoice.jsx

Highlight the proper line differences

* docs: sign the CLA
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet