score:4

Accepted answer
<script src="https://unpkg.com/react@16/umd/react.development.js" crossorigin></script>
<script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js" crossorigin></script>
<script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>

<div id="root"></div>

<div id="container"></div>

<script type="text/babel">
  const hide = () => { var elem = document.getElementById("two"); elem.style.height = "0px"; }; ReactDOM.render(
  <div id="one">
    <h1>this is Div one</h1>
    <div id="two">
      <h1>why this h1 is not hidden after the click</h1>
      <button onClick={hide} id="hide">click me</button>
    </div>
    <div id="three">
      <h1>this is div three</h1>
    </div>
  </div>, document.getElementById('container') )
</script>

Related Query

More Query from same tag