2
我有一个是这样写的无状态组件比较PARAM每次家长呈现
//stateless component
const ComponentOne = ({ month }) => {
console.log(month); // print incremental of 1 when I render parent component
}
,月从其父母传给一个无状态的组件。
render(){
return(
<ComponentOne month={ month }/>
)
}
它它的父母我可以改变月份并将其传递下去。如何在每次父母呈现后检查月份是否有所不同?使用componentWillRecieveProps?但是这个组件是一个无国籍的组件。