Answer the question
In order to leave comments, you need to log in
How to refer from one React component to the DOM of another component?
Good afternoon!
There are two components - conventionally one draws a map, and the other points on it. The application is written so that none is a child of the other.
Now the dot-drawing component does it via document.getElementById("Id-maps") and puts them in absolute position. I don't like this implementation, I want to do it according to my mind.
Questions - how can I competently implement this using React? Do I need to include Redux?
Answer the question
In order to leave comments, you need to log in
As it is more convenient for the project, you do it, if there are not many intercomponent connections, then you can limit yourself to one react, in this case, combine them with a parent component and keep the general state in state there.
You can connect redux and pass data through the store, this will be convenient if you want to receive this data in other components.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question