score:1

Accepted answer

const ShowMe = () => {
  return (
    <div className="hi"></div>
  )
};

ReactDOM.render(<ShowMe />, document.getElementById("target"));
#target {
  position:absolute;
  left:0;
  right:0;
  margin:0 auto;
  top:50%;
  transform:translateY(-50%);
  border:1px solid red;
  width:600px;
  height:500px;
}

.hi {
  border:1px solid blue;
  position:absolute;
  width:50%;
  height:40%;
  left:0;
  right:0;
  margin:0 auto;
  top:50%;
  transform:translateY(-50%);
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/16.6.3/umd/react.production.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react-dom/16.6.3/umd/react-dom.production.min.js"></script>
<div id="target">
</div>

score:0

ReactDOM.render(< ShowMe />, document.getElementById("target"));

Related Query

More Query from same tag