static propTypes = {
// Value to display
value: PropTypes.string.isRequired,
// Wheter this values was chosen by user or not
isChosen: PropTypes.bool.isRequired,
// Gets called when user choses this value
onChoose: PropTypes.func.isRequired,
}
爲什麼在定義上述PropType時需要添加'.isRequired'?我是一個反應原生開發者在React-Native中定義靜態PropTypes時,「.isRequired」的含義