Nav bar save props#2211
Merged
Merged
Conversation
This commit saves navBar component props in propsRegistry and restores the saved props when the component is mounted, allowing us to pass unserializable props to custom navBar component.
thanhzusu
pushed a commit
to thanhzusu/react-native-navigation
that referenced
this pull request
Nov 27, 2017
* master: (22 commits) setTabButton to change the label of the TabButton (wix#2215) 3D Touch Preview API (wix#2186) Update android-specific-use-cases.md Update android-specific-use-cases.md Load props from props registry for redux screens Nav bar save props (wix#2211) Support passing unserializable props to custom navBar component Save buttons props for root screens Ensure that styles set on individual buttons are not overridden (wix#2200) Update top-level-api.md (Android) Allow disableOpenGesture right or left in the drawer (wix#2189) Revert "Support iOS 11 prefersLargeTitles #1643 (wix#2090)" (wix#2204) Support iOS 11 prefersLargeTitles #1643 (wix#2090) Support passing unserializable props to custom button (wix#2192) addOnNavigatorEvent improvements (wix#2175) Fix missing props (wix#2179) Revert "Don't custom button props over the bridge (wix#2174)" (wix#2177) Don't custom button props over the bridge (wix#2174) Set missing TopBar background color Register multiple navigatorEventListeners (wix#2173) ...
garrettm
pushed a commit
to Ginger-Labs/react-native-navigation
that referenced
this pull request
Dec 19, 2017
This commit saves navBar component props in propsRegistry and restores the saved props when the component is mounted, allowing us to pass unserializable props to custom navBar component.
garrettm
pushed a commit
to Ginger-Labs/react-native-navigation
that referenced
this pull request
Dec 19, 2017
This commit saves navBar component props in propsRegistry and restores the saved props when the component is mounted, allowing us to pass unserializable props to custom navBar component.
|
Hello @guyca ! Thank you for bringing in this change. Unfortunately, when I tried to pass the Here's my code: ViewContainer.js Below is the error I see: Anything obvious that I am doing wrong ? |
|
@ghoshabhi you are getting RNN from master branch or npm package? |
|
@witalobenicio : Thank you for your suggestion. I think we are using a forked version at our company. Will try out your suggestion 👍 Thanks! |
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.

fixes #1961, #1546, #1705
This commit changes the way props are injected into custom navBar components. Instead of passing props over the bridge and initializing the native component with them, props are now stored in Js, and are injected back when the react component is created.
This change lets us pass unserializable props to the component.
For example, passing a navigator to the component is now possible: