-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Description
Hi !
I would like to understand how works the Actions.pop function a little.
I have a simple app with two views. On the first one, I just display data than user have to edit by himself. And on the second screen, the edit view to add data.
By default user didn't have data display and is invited to edit data. I use a onPress={ Actions.add } to redirect him to the edit screen. After user save is data, there is a back button to call the onPress={ Actions.pop } to the list view.
This is where I struggled a little bit.
- When I press the back button, and go back to the list view, the
componentDidMountis not called again. - However, I have a lifecycle with
componentWillReceiveProps, but the function render two times my list view. When I press the back button,componentWillReceivePropsis triggered with the old list view, and 300ms after a newcomponentWillReceivePropsis triggered with the new data. It seems buggy to the user to saw the last data during a second before seeing his new edited data. - If I replaced the onPress function with a
onPress={ Actions.list }instead of Actions.pop, thecomponentDidMountevent is mounted, but I loose my nav stacks, and the gestures are broken.
How can I fix this issue and what's the best way to do it ?
Thanks in advance.
Metadata
Metadata
Assignees
Labels
No labels