Suppose I have two different DOM elements
<div id="firstDiv">
</div>
<div id="secondDiv">
</div>
Now let's say that I render some html inside firstDiv using
React.render(firstComponent(null),document.getElementById('firstDiv');
Now let's say that I get some data from the server inside the firstComponent, and then I have to display some of the data inside the secondDiv , what is the best way to do this? Can I call React.renderComponent (, document.getElementById ("secondDiv")) from within firstComponent ?? And how to achieve two-way communication between them ??? Say now I click the link in the html displayed in the second Div, then how to change the text inside the firstDiv ??
If I summarize this question, it will be "How to visualize html inside several DOM elements from one component, and then exchange data with these components that appear in different DOM elements?"
source
share