Git Product home page Git Product logo

Comments (9)

github-actions avatar github-actions commented on April 27, 2024 1

The versions mentioned in the issue for the following packages differ from the latest versions on npm:

  • @react-navigation/native (found: 6.0.2, latest: 6.1.10)
  • @react-navigation/stack (found: 6.1.1, latest: 6.3.21)

Can you verify that the issue still exists after upgrading to the latest versions of these packages?

from react-navigation.

github-actions avatar github-actions commented on April 27, 2024

Hey @chuckjrussell! Thanks for opening the issue. It seems that the issue doesn't contain a link to a repro.

The best way to get attention to your issue is to provide an easy way for a developer to reproduce the issue.

You can provide a repro using any of the following:

A snack link is preferred since it's the easiest way to both create and share a repro. If it's not possible to create a repro using a snack, link to a GitHub repo under your username is a good alternative. Don't link to a branch or specific file etc. as it won't be detected.

Try to keep the repro as small as possible by narrowing down the minimal amount of code needed to reproduce the issue. Don't link to your entire project or a project containing code unrelated to the issue. See "How to create a Minimal, Reproducible Example" for more information.

You can edit your original issue to include a link to the repro, or leave it as a comment. The issue will be closed automatically after a while if you don't provide a repro.

from react-navigation.

chuckjrussell avatar chuckjrussell commented on April 27, 2024

I can confirm that this still happens under the latest versions, and that I've attached example code generating the issue

from react-navigation.

chuckjrussell avatar chuckjrussell commented on April 27, 2024

I've updated the repro example to be the root of the repo for clarity, here's the link to the StackNavigation in the application https://github.com/chuckjrussell/notetaker/blob/main/src/Navigation.tsx

from react-navigation.

khagesh avatar khagesh commented on April 27, 2024

Your navigation files does not include Notes screen inside Stack.Navigator. Can you please try including one more Stack.Screen and adding giving it a Notes screen component and same name as in linking config.

from react-navigation.

chuckjrussell avatar chuckjrussell commented on April 27, 2024

Hey there @khagesh thanks for getting back to me! the version of the code in the repo differs from the code pasted up top because the code up top (which includes notes) was a reesult of having trid just about every iteration and example (and removing everything else like authentication etc) to try and diagnose what's going on.

I can assure you that both produce the error I'm seeing, I'm happy to push the changes into the repo if it makes it more straightforward to diagnose, but originally (in the sample code it was intended on being /home?noteId=1, and over the course of trying different people's implementations, and trying anythign else I could to figure it out, I tried changing names adding a second debug page (hence the Demo in the code above

from react-navigation.

chuckjrussell avatar chuckjrussell commented on April 27, 2024

Of note, in the code provided in the repo, the issue only appeared as not updating the query params, eg

when on /Home, navigation.navigate("Home", {noteId: 1}) wouldn't update the query string and the url to /Home?noteId=1, and navigation directly to /Home?noteId=1 would take you directly to /Home and update the url by removing the params.

During the course of debugging (changing the name to notes, and adding the demo page), I discovered the more general pattern:

  1. If I added a page, the default landing page wasn't just /Home, it was whatever was first screen in the StackNavigator, unless I specified an initialRouteName
  2. if I supplied an initial param in the route, <Stack.Screen name="Home" component={HomeScreen} initialParams={{noteId: 1}} /> when navigating to anything, it would redirect to /Home?noteId=1

I will update my example code and expected behavior to match the code in the repo for clarity sake

from react-navigation.

chuckjrussell avatar chuckjrussell commented on April 27, 2024

Repo and example have both been updated to match each other's rotes and names, and I can confirm the issue still exists

from react-navigation.

chuckjrussell avatar chuckjrussell commented on April 27, 2024

Update, I've figured out what the issue is, after systematically disabling and console logging, I've discovered that the issue is that React Navigation for Web doesn't allow strict mode. Of course, now that I know what to google, I've found this thread of the same issue, #10988.

from react-navigation.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.