Chefk5
Chefk5

Reputation: 469

How to handle data fetching in multiple components in React Native?

I am new to React Native. Currently, I have multiple components, and each component does several fetches before rendering. The idea that I have to make a loading screen while the app.js is rendering. But then, other components will still be loading when app.js is shown. What is the best way to do all the fetches in all components while loading the app. I have found about Higher Order Component and Redux. However, I don't know what is the best approach to use.

Upvotes: 0

Views: 659

Answers (1)

Alex Shtromberg
Alex Shtromberg

Reputation: 837

I would say that there are 3 main concepts and realizations for today that solve the issue you have.

There is no Best or Correct way to handle the global state, just one you chose. One concept can be more familiar for you, other super-new. I would recommend you to read the documentation and one you think is easier to work with - is one you need.

Upvotes: 1

Related Questions