Comments (9)
Hey Jared!
As for CardStack, yeah there are a handful of old props left over from the NavigationExperimental views that were moved over. For now I think the best approach is to clean them up, and we can revisit adding things in later.
@satya164, could you make sure the flow types and docs are up to date for screenProps
?
from react-navigation.
@ericvicenti screenProps
are typed as {}
since they can hold arbitrary objects. Not sure what I have to change there.
from react-navigation.
As a side note, while reading the docs I got a bit confused by whether screenProps
is the same thing as this.props.navigation
object in each screen, maybe it was just an old name?
from react-navigation.
@coodoo, screenProps
are extra props that will be passed through the navigator into each screen component, in addition to the navigation prop. Could you submit a PR to help clarify the docs?
from react-navigation.
@satya164 screenProps
are not listed in a bunch of places -- for example, I believe that NavigationContainer
should list screenProps
as a thing it accepts
from react-navigation.
@jaredly NavigationContainer
doesn't accept screenProps
- https://github.com/react-community/react-navigation/search?utf8=%E2%9C%93&q=screenProps&type=Code
from react-navigation.
@satya164 I believe that it does
Here's the trail:
from StackNavigator
return createNavigationContainer(createNavigator(router)(props => (
<CardStack
{...props}
headerComponent={headerComponent}
headerMode={headerMode}
mode={mode}
/>
)), containerOptions);
createNavigationContainer
and createNavigator
both spread in all props.
And then CardStack
accepts screenProps
.
TLDR I had to read a ton of source code to realize that I could do
const SomeStack = StackNavigator({
// config
});
<SomeStack
screenProps={/* these will get passed to the screen components */}
/>
Please fix the docs so future users don't have to read all your source code.
from react-navigation.
@ericvicenti Absolutely, will see how to merge all above mentioned details into the docs.
from react-navigation.
Closing as we are now generating prop-types directly from flow
which should make it more up-to-date.
from react-navigation.
Related Issues (20)
- Regression in material top tabs scrolling behavior in RN 0.73 HOT 2
- Drawer headerRight button also opens in the headerLeft. HOT 2
- React native bottom tab bar pushing itself up when opening keyboard HOT 3
- ReactNavigation doesn't build on ReactNative 0.73.5 on iOS (on Android everything is ok) HOT 1
- React native tabview stuck on iOS while switching tabs HOT 3
- Screen presentation type "modal" flickers when opening datepicker on iPhone SE (2022)
- Header focus issue on AndroidTV HOT 1
- 'createDrawerNavigator' is crashing the app
- Height of header with active search input seems to be ignored during back navigation transition on iOS
- 7.0.0-alpha `static` router conditional not working on iOS HOT 6
- Issue unit testing a navigation container (createInteractionHandle is not a function) HOT 3
- Elements with `position: absolute` disappear during screen transition HOT 3
- Crash due to useNativeDriver true for tab animations with android 12 devices HOT 3
- Cannot read property 'name' of undefined in "MaterialTopTabView" HOT 4
- Dropdown and popover components opening at incorrect position in iOS when using default header in React Navigation 6 stack HOT 2
- getState typescript error after version 6.1.10 HOT 1
- Header height not getting calculated in pageY value for components in new architecture HOT 3
- Incorrect pageY value when only using default header of react navigation stack in new architecture HOT 3
- v7 Navigating back randomly causes NAVIGATE action to be dispatched instead of GO_BACK HOT 2
- Possible EventEmitter memory leak detected HOT 1
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 react-navigation.