Answer the question
In order to leave comments, you need to log in
How to open different divs when clicking on different blocks?
How to open at a clique - I understand. But how can a certain div be "attached" to a block? So that when you click, different ones open. On pure JS, one could use data-target for example.
Answer the question
In order to leave comments, you need to log in
You must have some component that is "above" all the components where you need to show/hide something. With it, you make a true / false state, which will be responsible for showing / hiding the block. (Instead of all this, you can use redux)
You pass this state through props to all places where you need to show / hide something depending on it
Of course, I described it rather abstractly
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question