I
I
Insolation2018-04-12 12:53:43
React
Insolation, 2018-04-12 12:53:43

How to work with the API?

Hello. I'm new to React so this is the question. I'm making an application for an interview. I work with the API, send a request, I receive an array of data in response, and from this data I already make content (a separate component).
Question:
1. Should this array, which I receive, be stored in state?
2. Is it okay to pass state as props to a component?
3. Is it right to do as in the picture?
5acf2ca42f09c843179766.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Anton Spirin, 2018-04-12
@Insolation

1. yes
2. yes
3. it is better to save data in state , and map it already in render

O
Oleg Gamega, 2018-04-12
@gadfi

If not for helovord, then requests from the evil component
use redax or analogues

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question