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

Unexpected remount on client-side routing (@gatsbyjs/reach-router) #38107

Closed
2 tasks done
bebbi opened this issue May 23, 2023 · 1 comment
Closed
2 tasks done

Unexpected remount on client-side routing (@gatsbyjs/reach-router) #38107

bebbi opened this issue May 23, 2023 · 1 comment
Labels
type: bug An issue or pull request relating to a bug in Gatsby

Comments

@bebbi
Copy link

bebbi commented May 23, 2023

Preliminary Checks

Description

Since the router, like @reach/router, doesn't seem to support optional parameters, my use-case is to simulate an optional parameter in an editor that should not get remounted:

    <Router basepath="/">
      <Editor path="/" />
      <Editor path="/:someId" />
    </Router>

Once someId is processed, we navigate('/').
But the issue is that the editor gets remounted and loses state.

It seems that this was an issue introduced between @reach/[email protected] and 1.3.4
Another useful description and a repro is here (gh issue link).

Reproduction Link

https://github.com/gustafc/reach-remounts

Steps to Reproduce

See the instructions in the repro repo.

Expected Result

The above routing config should not unmount any part of <App />

Actual Result

The above routing config unmounts and remounts all of <App />

Environment

System:
    OS: macOS 13.3.1
    Shell: 5.2.15
  Binaries:
    Node: 19.8.1 - /private/var/folders/ht/18wcb1f538bgx47qrfc1n0q80000gq/T/xfs-a8153025/node
    Yarn: 3.4.1 - /private/var/folders/ht/18wcb1f538bgx47qrfc1n0q80000gq/T/xfs-a8153025/yarn
    npm: 9.5.1
  Browsers:
    Chrome: 113.0.5672.126
    Firefox: 113.0.1
    Safari: 16.4

Config Flags

No response

@bebbi bebbi added the type: bug An issue or pull request relating to a bug in Gatsby label May 23, 2023
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label May 23, 2023
@LekoArts LekoArts removed the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label May 23, 2023
@LekoArts
Copy link
Contributor

LekoArts commented May 23, 2023

Hi!

This repository is for issues related to Gatsby. In client-side only routes of Gatsby you can use any router you want, you don't need to use reach-router. We only use a forked version of it for our own SPA navigations.

Thus this is not something we'll fix. You can use https://reactrouter.com/en/main or https://tanstack.com/router/v1 since reach-router is no longer receiving any updates.

@LekoArts LekoArts closed this as not planned Won't fix, can't repro, duplicate, stale May 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug An issue or pull request relating to a bug in Gatsby
Projects
None yet
Development

No branches or pull requests

2 participants