G
G
Gimir2020-02-14 13:01:10
React
Gimir, 2020-02-14 13:01:10

Is it possible to make AJAX requests from a container in React if the project uses Redux?

Good afternoon, such a task:
I have a certain state on Redux in the project, I need to make a json fetch and use it (all) in one container, and use only one field from json in the Redux global state.
Question: can I make a request not from action_creator, but directly in the container after rendering and from there dispatch the required object to the state? Isn't this a bad practice?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Oleg Gamega, 2020-02-14
@gadfi

bad practice, I don't see the point

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question