-1

I'm building a web app, and it will fetch JSON files which will be used in multiple react components.

How is this usually done?

I have thought about importing JSON objects from where they are fetched, but I think that is probably not a good idea. I currently use redux actions to fetch JSONs and store them in redux states.

Is there a better way to do this?

Oatmeal
  • 19
  • 3
  • You can use global state management like React context to share the data between multiple components instead of passing props down to the components individually. – Simeon Ikudabo Sep 03 '23 at 03:16
  • @SimeonIkudabo OP said they are already using Redux and are asking for something *"better"*. Also, the React Context API isn't state management. – Drew Reese Sep 03 '23 at 03:33

0 Answers0