Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
Tags
- DB
- data structure
- CSS
- system
- react
- python
- mysql
- instruction
- architecture
- Class
- DS
- for
- function
- DoM
- DATAPATH
- Algorithm
- Java
- php
- MacOS
- Linux
- while
- javascript
- github
- Pipelining
- control
- computer
- XML
- web
- html
- MIPS
Archives
- Today
- Total
목록onClick (1)
YYYEJI
[React] 버튼 onClick 속성에 두 개의 기능 넣기
우선 onClick에 넣을 두 개의 함수를 선언합니다. const [counter, setCounter] = React.useState(1); const [sum, setSum] = React.useState(0); const onCount = () => { setCounter((current) => current+1); } const onSum = () => { setSum((current) => current+1); } tag 안에 onClick 속성을 아래와 같이 넣어주면 {onCount(); onSum();}}>Button 두 개의 기능을 하는 버튼을 생성할 수 있습니다. ◡̈
Web Application Server (WAS)
2023. 1. 14. 12:10