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
- SCSS
- input type=file
- API token
- react typescript
- git lab
- next.js css
- 컨디셔널 렌더링
- getModifierState
- ngrok실행
- bootstrap
- icon
- createGlobalStyle
- styled components
- fetch
- dart 변수
- Git
- nextjs
- nextjs 설치
- rewrites
- ngrok설치
- nextjs .env
- github io
- npm styled-reset
- There isn’t anything to compare
- react
- react env
- typescript react
- CSS
- API 토큰
- github
Archives
- Today
- Total
목록props type (1)
꾸준히 성장하는 개발자

react에서는 props의 데이터 타입을 잘못 입력해도 문법상 문제가 없다면 에러메시지 없이 화면 출력이 된다 function App() { return ( ); } const root = document.getElementById("root"); ReactDOM.render(, root); text prop에는 string으로 써야 하고 fontSize prop에는 숫자로 작성을 해야 하는데 이렇게 작성이 되어도 react에서는 오류로 인지하지 못하고 화면에 출력이 되게 된다. 이런 경우에 이런 실수를 막을 수 있도록 하는 방법이 props type이다 이걸 위에 추가해주고 Btn.propTypes = { text: PropTypes.string, fontSize: PropTypes.number, }..
React
2022. 2. 28. 06:44