I'm coming from Angular, trying to learn React (Native). How do we implement Angular's concept of a "Service" in React?
For example, I would like to do the following:
- Get data from external API as json
- Do something to data, e.g. modify each item
- Make modified data available to multiple components of the app
This is extremely easy and convenient in Angular using a Service, and injecting that Service into any Components that need access to the data.
How is this achieved in React?
No comments:
Post a Comment