Comments (7)
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.
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:
from rfcs.
@dantman - could you open a RFC for this? I'd love to get this in soon
from rfcs.
I will try to create a PR asap!
from rfcs.
here: react-navigation/core#11
from rfcs.
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.
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.
@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)
- Action property that indicates to routes that they should not change index HOT 1
- Improve ergonomics of back HOT 1
- Navigator config to pass params down HOT 1
- Add unsetParams to navigation prop HOT 2
- Reset state action HOT 2
- Expose logic for initializing state of createAppContainer HOT 4
- On will/didFocus subscribe, stop firing the listener if current screen is focused HOT 2
- Idea: Preloading HOT 6
- <StaticNavigator> for tests/storybook HOT 14
- StackActions.popToRouteName(routeName) HOT 2
- Alternative API for defining navigators HOT 12
- how to send navigation events between peer navigators? HOT 4
- Deep linking with authentication
- How to hide tab bar item n react-navigation HOT 3
- Ability to show screens on top of native modals
- useNavigationParams hook HOT 1
- Add useMaterialTabsHeight HOT 1
- Typesafe Stack & Navigation HOT 1
- devTools prop HOT 5
- [RFC] TabView API change
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rfcs.