React-native: function call when returning from scene

I work in an application to transfer data between scenes or views. My escenario is simple, I have a Navigator component as the father of two scenes:

  • Toolbar: contains a list with some data.
  • Details: displays the data of the item selected in the previous list.

The following lines explain the behavior I want to get:

  • Log in to your Personal Account: request data from the leisure server and draw it in the list.

  • Scroll to Details: select an item in the control panel.

  • Change the item: change the property of the item I selected, then go back.

  • Return to the dashboard: request data from the leisure server and draw it in the list (like the first point, I want to get new data if it was generated from the first to the third.

My question is how can I update a scene or call a scene function when it takes focus (fourth point described above). This is because it has not been unmounted.

I also checked the interactive documents I tried using the following methods: componentWillReceiveProps (), shouldComponentUpdate (), componentWillUpdate (), etc. but no one worked.

Thank.

+4
source share
1 answer

-. / . .

- , - . , RefreshControl (ListView)

+1

Source: https://habr.com/ru/post/1675939/


All Articles