<!DOCTYPE html>
<html>
<body>
<div id="root"></div>
</body>
<script src="https://unpkg.com/react@17.0.2/umd/react.production.min.js"></script>
<script src="https://unpkg.com/react-dom@17.0.2/umd/react-dom.production.min.js"></script>
<script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
<script type="text/babel">
const root = document.getElementById("root");
function App() {
const [counter,modifier] = React.useState(0);
return(
<div>
<h3>클릭횟수 : {counter}</h3>
<button>누르시오</button>
</div>
);
}
ReactDOM.render(<App />,root);
</script>
</html>
React.useState();는 배열을 받는다. [앞에는 데이터값(counter), 뒤에는 데이터값을 바꿀때 사용할 함수]