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
- system
- python
- DS
- Class
- Linux
- XML
- architecture
- instruction
- Algorithm
- html
- github
- DB
- react
- web
- control
- for
- function
- Java
- DATAPATH
- while
- CSS
- MIPS
- php
- DoM
- computer
- mysql
- MacOS
- data structure
- javascript
- Pipelining
Archives
- Today
- Total
목록props (1)
YYYEJI
[React] 함수형 컴포넌트에 props 전달하기
props는 속성을 나타내는 데이터입니다. props를 인자 값으로 받는 함수형 컴포넌트를 하나 만들어 줍니다. function Component(props) { if (props.value===10) { return The number is 10.; } return null; } props.value에서 value는 속성 이름입니다. 아래 코드에서 value 속성에 값을 할당시켜 줍니다. function Question() { const [counter, setCounter] = React.useState(1); return ( ); } counter의 값이 1이기 때문에 return 값은 null이 되지만, 초기값을 9로 바꿔주면 return 값이 생깁니다. ◡̈
Web Application Server (WAS)
2023. 1. 13. 23:13