まずボタンをつくります。 <button type="button" </button> クリックしたときに起きる動作を追加します。 onclick="document.getElementById('demo').innerHTML = Date()" あとは表示する文字”Click me to display Date and Time”を書くと、最初にのせたコードになります。
But this results in the page error: Error: Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the ...