react-native: [NavigatorIOS] doesn't update when passProps update
I’m not sure if this is a feature or a bug:
When I change the value of passProps
of a navigator, I expect it would re-render again, just like other react components do. However, it seems it will not do so.
For example,
<NavigatorIOS
style={{flex: 1}}
initialRoute={{
component: MyChatList,
title: "My Chat List",
passProps: {
recentChats: this.state.ChatListData.recentChats,
renderRow: this.renderRecentChat,
},
}} />
When the state ChatListData
(which comes from flux) updates, the navigator will not update it self correspondly.
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Reactions: 4
- Comments: 33 (15 by maintainers)
Commits related to this issue
- Place create listens for location updates My original plan was to filter global state down through the component hierarchy, but given this bug: https://github.com/facebook/react-native/issues/795 It ... — committed to jackpine/totem by svevang 9 years ago
- Docs warn navigator ios Summary: ping https://github.com/facebook/react-native/issues/795#issuecomment-139895307 Closes https://github.com/facebook/react-native/pull/3087 Reviewed By: svcscm Differ... — committed to facebook/react-native by morenoh149 9 years ago
- Allow NavigatorIOS to define routes' `passProps` property as a function. * Allows internal scenes to react to changes in their passed properties. * By default, NavigatorIOS (and Navigator, to a less... — committed to bjornco/react-native by drtangible 8 years ago
- Allow NavigatorIOS to define routes' `passProps` property as a function. * Allows internal scenes to react to changes in their passed properties. * By default, NavigatorIOS (and Navigator, to a less... — committed to bjornco/react-native by drtangible 8 years ago
I don’t know
Yes. Please either remove it so people don’t get confused or put a big red warning in the docs saying “this component breaks the underlying working of react”. Wasted time until I found this bug.
What happened with this? I’m also experiencing this error. Apparently we were going to see a response in 30 days but that was about 5 or 6 months ago.
This issue seems like it is now a bunch of different issues combined. @felipemullen I suggest trying ExNavigation and complaining to @skevy if it is not good enough, rather than NavigationExperimental which we are figuring out how to combine with ExNavigation soon. I’m going to close this issue, and I suggest if people continue to have similar problems they open a new issue and be very clear about whether the problem applies to
Navigator
orNavigatorIOS
because they are pretty different in terms of getting them fixed.