728x90
반응형
const Title = (
<h3
id ="title"
onMouseEnter={()=>console.log("mouse enter")}
>
Hello I'm a title
</h3>
);
html과 비슷한 구조
- html element의 tag 생성
- 담고자 하는 메시지를 h3 태그 안에 넣어준다
- html element의 id 생성
- property는 html의 태그의 속성처럼 적는다
const Button = (<button
style={{backgroundColor="tomato",
}}
onClick={()=>console.log("I'm clicked")}
>
Click me
</button>
);
728x90
반응형
'React JS' 카테고리의 다른 글
react local repository 만들기 (1) | 2023.06.18 |
---|---|
react 설치하기 (0) | 2023.06.16 |
댓글