diff --git a/chenxuan1/src/pages/props.jsx b/chenxuan1/src/pages/props.jsx index b205aeaaf..3519266a0 100644 --- a/chenxuan1/src/pages/props.jsx +++ b/chenxuan1/src/pages/props.jsx @@ -4,7 +4,7 @@ class Child extends React.Component { static propTypes = { name:PropTypes.string.isRequired, //限制name必传,且为字符串 sex:PropTypes.string,//限制sex为字符串 - age:PropTypes.string,//限制age为数值 + age:PropTypes.number,//限制age为数值 }; static defaultProps = { name: "chenxuan", @@ -24,8 +24,8 @@ class Child extends React.Component { render() { return (