Notice
Recent Posts
Recent Comments
Link
250x250
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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
- 아이콘사용법
- MediaQuery
- window 정책변경
- vscode git clone
- node설치
- 정적객체
- 단어단위로떨어지기
- slickslider
- 웹아이콘
- googleicon
- Git clone
- 동적객체
- npm start
- package.json
- npm install
- minwidth
- npm install 문제
- 글자들여쓰기
- 이미지반응형
- node 오류
- git lab clone
- 그누보드반응형
- 플러그인
- fontawesome
- owlcarousel
- maxwidth
- 의존성문제
- legacy-peer
- XEIcon
- react npm install
Archives
- Today
- Total
어쩌다 알게 된 ƪ(•̃͡•̃͡ ƪ
[React] 18버전 컴포넌트 props 매개변수 기본값 warning 본문
728x90
Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead. Error Component Stack
17버전에서 사용되던 방식
export const NavigationLine = ({ className }) => {
return <hr className={classNames('navigation-line', className)} />;
};
NavigationLine.defaultProps = {
className: null,
};
18버전 부터 경고 뜨고 19버전에 없어질수도 있는 방식이라 변경하는게 좋을 듯
변경 방식 (최신 권장 방식)
export const NavigationLine = ({ className = null }) => {
return <hr className={classNames('navigation-line', className)} />;
};728x90
'개발 > 🟦 React' 카테고리의 다른 글
| 리액트 크롬 디버깅_리렌더링 된 컴포넌트 하이라이트 하기 (0) | 2025.06.05 |
|---|---|
| [React] app router_ 폴더 기준 (0) | 2025.05.03 |
| [React] hook, useMemo(), useCallback() (0) | 2025.04.29 |
| [React] 차트 라이브러리 react-apexcharts, apexcharts (1) | 2025.04.28 |
| [React] default export와 named export (0) | 2025.04.25 |
Comments
