React-Proptypes-docs
ํ์
| ๊ฒ์ฌ ๋ฐฉ๋ฒ |
---|
๋ชจ๋ ํ์
| PropTypes.any |
Number ๊ฐ์ฒด | PropTypes.number |
String ๊ฐ์ฒด | PropTypes.string |
Boolean ๊ฐ์ฒด | PropTypes.bool |
Function ๊ฐ์ฒด | PropTypes.func |
Array ๊ฐ์ฒด | PropTypes.array |
Object ๊ฐ์ฒด | PropTypes.object |
Symbol ๊ฐ์ฒด | PropTypes.symbol |
Node ๊ฐ์ฒด | PropTypes.node |
React ์์ | PropTypes.element |
์ฌ๋ฌ ํ์
์ค ํ๋ | PropTypes.oneOfType([PropType.number, PropType.string]) |
ํน์ ํด๋์ค์ ์ธ์คํด์ค | PropTypes.instanceOf(Date) |
์ ๋ฌ ์์ฑ ์ ํ | PropTypes.oneOf([โnameโ, โcareerโ]) |
ํน์ ํ์
์งํฉ์ผ๋ก ์ ํ | PropTypes.arrayOf(PropTypes.string) |
ํน์ ํ์
์ ์์ฑ ๊ฐ์ผ๋ก ํ๋ ๊ฐ์ฒด ์ ํ | PropTypes.objectOf(PropTypes.number) |
ํน์ ํํ๋ฅผ ๊ฐ๋ ๊ฐ์ฒด ์ ํ | PropTypes.shape({ prop1, prop2 }) |
isRequiredย ์ค์ ์ ํ์๋ก ์ ๋ฌ ๋ฐ๋ ์์ฑ์ ๋งํฉ๋๋ค.
์ค์ | ์ค๋ช
|
---|
PropTypes.string.isRequired | ๋ฌธ์ ํ (ํ์) |
PropTypes.number.isRequired | ์ซ์ ํ (ํ์) |
PropTypes.func.isRequired | ํจ์ ํ (ํ์) |
PropTypes.bool.isRequired | ๋ถ๋ฆฌ์ธ ํ (ํ์) |