- 리액트에서는
- class -> className
- for -> htmlFor
- 단위 변환기(value를 인식하는 부분)
function App() {
const [minutes, setMinutes] = React.useState();
const onChange = (event) => {
setMinutes(event.target.value);
};
return (
<div>
<h1>Super Converter</h1>
<label for="minutes">Minutes</label>
<input value={minutes} onChange={onChange} id="minutes" placeholder="Minutes" type="number"/>
<h4>You want to convert {minutes}</h4>
<label for="hours">Hours</label>
<input id="hours" placeholder="Hours" type="number"/>
</div>
); //변수를 컴포넌트에 연결
}