J
J
Junior2016-08-13 10:55:34
JavaScript
Junior, 2016-08-13 10:55:34

Passing value from one module to another, Reactjs?

Hello! Started learning ReactJs and came across this problem.
It was necessary to pass a value from one component to another and I eventually found a solution, but when I split the components into separate modules ... everything works, but React throws an error, such as incorrect data transfer. Who faced such a problem, how to pass the value to another component (module) in this case? codepen.io/juniorCh/pen/ZOqLov (callbackparent method in NoteColor and NoteEditor)
I would be very grateful for your help)
d3e08b0cc1b64a0f89e6d38ec4eea94e.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Anatoly, 2016-08-13
@taliban

Can you describe the problem in more detail? Purely theoretically, using React, you do not need to pass anything, each React component must be self-sufficient, on the other hand, there are properties that can be passed to the component. But if you need to transfer a value from the internal to the outside or to the neighboring one, then this is already a completely wrong approach. It's just that your question is too vague, if you describe it in more detail (what exactly needs to be transferred where), then maybe they will give you advice on how to do it differently.

N
Nikolai Antonov, 2016-08-19
@my-nickname

Can be passed using redux or eventemitter3 .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question