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