Coder Social home page Coder Social logo

Comments (23)

n1ru4l avatar n1ru4l commented on May 2, 2024 45

@spruce-bruce Can't we have a more generic API that might be more expandable in the future?

e.g. like

props.navigation.navigate({
  screen: `Screen`,
  params: {},
  transitionConfig: {}
})

I prefer having a single object with sub-properties over having list of arguments

from rfcs.

spruce-bruce avatar spruce-bruce commented on May 2, 2024 21

This is related - have you thought much about allowing the ability to override transitions per navigate call as well? It's kind of edge casey, but I can imagine creating a screen and wanting to choose at time of navigation how the transition will happen.

props.navigation.navigate('Screen', params, transitionConfigOverride)?

from rfcs.

hxiongg avatar hxiongg commented on May 2, 2024 5

Any update on this?

from rfcs.

brentvatne avatar brentvatne commented on May 2, 2024 5

you can do this in v5. https://www.youtube.com/watch?v=PvjV96CNPqM. just use options on screen instead of on navigator

from rfcs.

n1ru4l avatar n1ru4l commented on May 2, 2024 4

Would be awesome if there is also a way to specify the gestures for that screen. E.g. using the example of your Problem section results in a gesture that do not match the animation.

from rfcs.

marcshilling avatar marcshilling commented on May 2, 2024 2

What @spruce-bruce said above is what I need. My use case is a button that the user can tap to push a screen (with animation), versus me wanting to programmatically push that screen without animation when something else happens.

from rfcs.

brentvatne avatar brentvatne commented on May 2, 2024 2

stack is being rewritten - react-navigation/stack#131

from rfcs.

brentvatne avatar brentvatne commented on May 2, 2024 1

@kaantyy: https://github.com/react-navigation/react-navigation-stack/blob/dab7f2515e2bc7c3b57a89a23f9c3ed2dfdece44/src/index.js#L28-L42

from rfcs.

DriesVS avatar DriesVS commented on May 2, 2024

I have the same fix! But as @n1ru4l pointed out, the gesture direction is defined by mode. Would be handy to dynamically configure the gesture direction based on sceneProps.

from rfcs.

jemmyphan avatar jemmyphan commented on May 2, 2024

@brentvatne if I'm not mistaken. since react-navigation/react-navigation@e27ad22, transitionConfig has had these parameters already. And it's working right now. is it safe to use it now? since the documentation hasn't been updated.

from rfcs.

brentvatne avatar brentvatne commented on May 2, 2024

@jemmyphan - I don't think so -- this works the same as before after that commit unless I'm missing something

from rfcs.

jemmyphan avatar jemmyphan commented on May 2, 2024

@brentvatne I totally missed react-navigation/react-navigation@2ee8548. 😅

from rfcs.

spruce-bruce avatar spruce-bruce commented on May 2, 2024

Certainly - I wouldn't be dogmatic about the api example I gave, just showing "fewest api changes" possible example to highlight the idea

from rfcs.

Bonobomagno avatar Bonobomagno commented on May 2, 2024

options specified per screen will always take priority over options specified globally.

Is this in react-navigation 2? Because it don't work on my navigator, using it per screen basis.

from rfcs.

djw27 avatar djw27 commented on May 2, 2024

Just wanted to jump on board here and say that coming from ex-navigation this feels like an area that's lacking.

We use modals and stacks within tabs fairly interchangeably and made heavy use of specifying the following when using ex-navigation:

static route = {
  styles: {
    ...NavigationStyles.FloatVertical, 
 },
}

on screens which we wanted to appear as modals.

The initial proposal from @satya164 is fairly similar similar to this - is there anyone working on this which I can help out with or does this need starting afresh?

from rfcs.

satya164 avatar satya164 commented on May 2, 2024

@spruce-bruce @n1ru4l I think that's also possible with the proposed API. You'll need to pass some param which you can check in the transition config to return a different animation.

from rfcs.

fbn4sc avatar fbn4sc commented on May 2, 2024

I cannot find CardStackStyleInterpolator.

Any workaround?

from rfcs.

Sixbitunder avatar Sixbitunder commented on May 2, 2024

@fbn4sc the CardStackStyleInterpolator has been replaced by StackViewStyleInterpolator

you can Import it by adding

import StackViewStyleInterpolator from 'react-navigation/src/views/StackView/StackViewStyleInterpolator';

remeber also to switch props in sceneProps

from rfcs.

elizond0 avatar elizond0 commented on May 2, 2024

@Sixbitunder
Thanks for your answer, it works.
when I swipe the page from left to right on android, how could navigation “go back” just like the ios gesture.

from rfcs.

kaantyy avatar kaantyy commented on May 2, 2024

I cannot find either CardStackStyleInterpolator or StackViewStyleInterpolator.

Workaround with v2.14.2?

from rfcs.

nandorojo avatar nandorojo commented on May 2, 2024

This would be an amazing addition.

from rfcs.

branegg avatar branegg commented on May 2, 2024

:(

from rfcs.

martinjuhasz avatar martinjuhasz commented on May 2, 2024

Are there any news on this @brentvatne ?

from rfcs.

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.