I
I
Ilya Kuminov2021-05-20 18:07:47
React
Ilya Kuminov, 2021-05-20 18:07:47

Can I call hooks in file [name2] which I wrote in file [name1]?

Essence of the question.
There is a file name1 , where I wrote the hook const [first, second] = useReducer(ddddd, new ssss([]), wwww()) Second
has data that came in the back, can I import this data into another file? If yes, how? I apologize in advance for the poorly worded question.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton, 2021-05-21
@Minister21

If I understand you correctly, you need to put your hook function into a separate file by doing export, and then include it in other files via import.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question