no message

This commit is contained in:
chenxuan
2024-04-18 16:14:42 +08:00
parent 1450c2966f
commit 204055c000
+3 -3
View File
@@ -4,7 +4,7 @@ class Child extends React.Component {
static propTypes = { static propTypes = {
name:PropTypes.string.isRequired, //限制name必传,且为字符串 name:PropTypes.string.isRequired, //限制name必传,且为字符串
sex:PropTypes.string,//限制sex为字符串 sex:PropTypes.string,//限制sex为字符串
age:PropTypes.string,//限制age为数值 age:PropTypes.number,//限制age为数值
}; };
static defaultProps = { static defaultProps = {
name: "chenxuan", name: "chenxuan",
@@ -24,8 +24,8 @@ class Child extends React.Component {
render() { render() {
return ( return (
<div> <div>
<Child/> {/* <Child/> */}
{/* <Child name="陈轩" age="100" sex="男"/> */} <Child name="陈轩" age={100} sex="男"/>
</div> </div>
); );
} }