I have a graphical bug on my react native app, and it appears only on iOS, not on android.
When I update the state of my application of the History screen (on startup, or when I add a ride, or when I remove a ride), the list of my ride items in history disappears (implemented using react native ListView). And I need to touch the screen to make it appear. After that, during navigation between screens, I have no issue (because I'm not rerendering the History screen).
I use redux + reactnavigation. On startup, I use a common action "LOAD_RIDES" that I reuse in every screen reducer to update its state. Same with actions ADD_RIDE, REMOVE_RIDE.
But I discovered, that if I navigate to History on startup automatically (by asking my navigation reducer to go to History on startup), and that the update of the screen happens after, while the history screen is displayed already, I don't have this bug (of history items hidden).
Any idea how to solve this? Thanks!
"react": "16.0.0-alpha.6",
"react-native": "0.44.0",
"react-navigation": "1.0.0-beta.9",
"react-redux": "^5.0.3",
to reproduce the bug, I created that repo: https://github.com/jcharlet/react_native_listview_bug
The interesting piece is HistoryScreen where the listView is created. https://github.com/jcharlet/react_native_listview_bug/blob/master/src/screens/history/HistoryScreen.js
The master branch shows the bug in action the unsatisfying_workaround branch shows that if I display the history screen before updating its state, it shows the list properly.
So far I tried unsuccessfully to
- scroll to 0,0 when rendering the screen using ListView.scrollTo
- to load rides again with redux when navigating to history screen
- upgrade react and react native to last versions
- generate a separate redux action for loading rides in history screen 'LR' (I otherwise use the same LOAD_RIDES action in hackDetails and History screens to update their states)
In Chrome dev tool I looked at the redux state before/after when I'm using the navigation work around (navigating to history screen before loading the rides) and when I'm not: nothing changes.

