Remark: this is not a duplicate of Change the state when clicking outside a component in React I do not want to handel mousedown/mouseup events.
I would like to do change the state of my component "from the outside". So the component will wait until some action id performed by the HTML code (button click). The click can change something in the DOM, but is there a way (another then watching for buttondown events) to detect the change?
The result will be like this:
<div id="root">
... the component will be rendered here, hidden at the beginning
</div>
<button onClick=....>Show the Component</button>