코딩/멋사11기3 8주차 리액트 import, this.props import React from 'react'; import PropTypes from 'prop-types'; import './style.css'; const ComponentWithFunction = ({name, favoriteColor, children}) => { return ( 안녕하세요 {name}입니다 🐶 동생은 {children}이에요 좋아하는 색은 {favoriteColor}입니다 !!! ); }; //props 기본값 설정 ComponentWithFunction.defaultProps = { name: '홍길동' }; //필수 props 지정 및 props 타입 지정 ComponentWithFunction.propTypes = { name: PropTypes.string, favor.. 2023. 5. 21. 과제8 보호되어 있는 글 입니다. 2023. 5. 14. 4주차-FLEX, GRID 보호되어 있는 글 입니다. 2023. 4. 5. 이전 1 다음