P
P
Persotr272021-09-22 21:25:42
JavaScript
Persotr27, 2021-09-22 21:25:42

Where to write a function dependent on redux value sets in a React application?

Hello. I want to make functions in the application that depend on many redux fields and are used in many parts (components). How to implement it from the architectural side? I suggest making a hook inside which to call useSelecror and select the desired values ​​from it, passing it to the function. Then just return the function / result of the function execution from this hook.
But, if the component where I'm using this scripted hook also (already) has a dependency on the redax fields that are used in the hook, wouldn't that be a double dependency, and would that be okay?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question