Fix TabViewAnimated screenProps caveat#862
Merged
satya164 merged 2 commits intoreact-navigation:masterfrom Mar 30, 2017
stochris:master
Merged
Fix TabViewAnimated screenProps caveat#862satya164 merged 2 commits intoreact-navigation:masterfrom stochris:master
satya164 merged 2 commits intoreact-navigation:masterfrom
stochris:master
Conversation
satya164
approved these changes
Mar 30, 2017
Member
|
I'll merge this, but you should really just connect individual screens instead of passing data in |
Author
|
I encountered the problem when using GraphQL. Normally, I'd' just skip the screenProps, but in my case, I load some data when on app, then render navigator ( and pass it the recieved data ) |
lintonye
added a commit
to lintonye/react-navigation
that referenced
this pull request
Apr 3, 2017
* master: Docs: Added clarification for header configuration (react-navigation#891) Fix gesturesEnabled regression (react-navigation#886) bump react-native-drawer-layout-polyfill (react-navigation#882) Fix rebase commands (react-navigation#870) Possibility to overwrite label's style if defined as string. (react-navigation#731) add example for DrawerNavigatorConfig (react-navigation#552) Workaround for screenProps in TabViewAnimated (react-navigation#862) Update Guide-Nested.md (react-navigation#813) remove ReactComponentWithPureRenderMixin (react-navigation#809)
sourcecode911
pushed a commit
to sourcecode911/react-navigation
that referenced
this pull request
Mar 9, 2020
bartlomiejbloniarz
pushed a commit
to bartlomiejbloniarz/react-navigation
that referenced
this pull request
Jan 7, 2026
const { itemId } = route.params;
const { otherParam } = route.params;
can be combine into {itemId, otherParam}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Please provide enough information so that others can review your pull request:
Accordin do the react-native-tab-view,
TabViewAnimatedis a pure component, and as such, will not be rerendered unless it's props change.This prevents rerenders when
screenPropsonTabNavigatorchange, and as such, is a major limitation when usingTabNavigator.The proposed solution is to pass the
screenPropsto theTabViewAnimated, even if does not use this in any way.Any change to the
screenPropsofTabNavigatorwill trigger a rerender inTabViewAnimated.Explain the motivation for making this change. What existing problem does the pull request solve?
Allows using
screenPropswithTabNavigatorPrefer small pull requests. These are much easier to review and more likely to get merged. Make sure the PR does only one thing, otherwise split it.
Test plan (required)
Don't know how much this could be tested, since I've only added
screenProps={this.props.screenProps}to theTabViewAnimatedcomponent.Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes UI.
Make sure you test on both platforms if your change affects both platforms.
The code must pass tests and shouldn't add more Flow errors.
Code formatting
Look around. Match the style of the rest of the codebase.