Q
Q
Quintis2019-12-05 16:43:19
JavaScript
Quintis, 2019-12-05 16:43:19

Import vs redux and react context?

Good day, such a question, why use React context or redux for simple data transfer between components if it is possible to import all data as an object through import? React context or redux work faster? Thanks

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Robur, 2019-12-05
@Quintis

context - to reduce cohesion. import binds the component with the file where the data is located and you can’t change it in any way. For example, this greatly interferes with tests.
redux is not at all about the fact that access to data and the import of some object cannot be replaced.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question