Coder Social home page Coder Social logo

Comments (7)

ericvicenti avatar ericvicenti commented on May 2, 2024 2

Could we call this defaultParams instead? I think its more technically accurate, because the initial params of the route may be overridden by the navigation actions

from rfcs.

dantman avatar dantman commented on May 2, 2024 1

An alternative for this would be to wrap FriendScreen so we have BrentFriendScreen which passes in some props. This is maybe also fine and makes me hesitant to want to include something like initialParams unless we have some motivating use cases where this is infeasible. So let's gather use cases here.

I wouldn't say technically infeasible, but I don't think creating 6+ wrapper screen components for the same screen just because you can't pass in initialParams is a good model.

I used a hack to fake initialParams for this very use case in a released app. Though I got tired of DrawerNavigator's limitations and started a refactor to make a future version just use a single Stack: StackNavigator() route and handle drawer items and handle dispatching navigation myself with reset.

Every single drawer item visible in this screenshot is the same Inbox screen but with different params:
screenshot_20180324-124905

from rfcs.

brentvatne avatar brentvatne commented on May 2, 2024

@dantman - could you open a RFC for this? I'd love to get this in soon

from rfcs.

n1ru4l avatar n1ru4l commented on May 2, 2024

I will try to create a PR asap!

from rfcs.

brentvatne avatar brentvatne commented on May 2, 2024

here: react-navigation/core#11

from rfcs.

donni106 avatar donni106 commented on May 2, 2024

I also want to realize a Drawer with different items navigating in one same stack.
Using params didn't work for me. Adding params to the RouteConfigs of my createDrawerNavigator did nothing. The params of a route were still empty. (react-navigation 2.18.2)
With setting up a CustomDrawerItems overwriting the onItemPress method, I am able to render the items and navigate correctly in one main stack.
bildschirmfoto 2018-10-29 um 17 30 39
My problem is, that the active item in my drawer is not changing. It is always the first item, which is active ('Start' in my example). I wonder how to set a clicked item active?

from rfcs.

brentvatne avatar brentvatne commented on May 2, 2024

@donni106 - because it's not released yet, it's only in the latest alpha version of 3.0. post a new issue with exactly what you want please

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.