本文实例讲述了react PropTypes校验传递的值操作。分享给大家供大家参考,具体如下: 校验传递的值: import React, { Component, Fragment } from 'react'; import List from './List.js'; class Test extends Component { constructor(props) { super(props); this.state={ inputValue:'aaa', list:['睡觉','打游戏'], } // this.add=t