Coder Social home page Coder Social logo

Replace stack about ex-navigation HOT 3 CLOSED

expo avatar expo commented on June 1, 2024
Replace stack

from ex-navigation.

Comments (3)

Froelund avatar Froelund commented on June 1, 2024 4

Nevermind - I figured it out.
I was actually on the right path ( Or route :) ).
immediatelyResetStack takes a second parameter index. This defines where on the new stack, you would like to end up.
So the code would be:

this.props.navigator.immediatelyResetStack([
    Router.getRoute('routeA'), Router.getRoute('routeC', {routeCSpecificProp: this.props.routeCSpecificProp}))
], 1); // Notice the 1

from ex-navigation.

Froelund avatar Froelund commented on June 1, 2024

Just to clarify if someone stumbles upon this issue. Instead of creating a new stack, you should reuse the one that are already made.

      var stackOfRoutes = this.props.navigator._getNavigatorState().routes;
      var newRoutesStack = [stackOfRoutes[0], stackOfRoutes[2]];
      this.props.navigator.immediatelyResetStack(newRoutesStack, 1);

from ex-navigation.

nadirHomeFriend avatar nadirHomeFriend commented on June 1, 2024

@Froelund great solution , thanks a lot

from ex-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.