static getDerivedStateFromProps(nextProps, state) {
if (nextProps.category !== state.category) {
return {
category: nextProps.category,
value: nextProps.options[0]
}
}
return null;
}
static getDerivedStateFromProps(nextProps, state) {
if (nextProps.category !== state.category) {
return {
category: nextProps.category,
value: nextProps.options[0]
}
}
return null;
}
本文标题:生命周期getDerivedStateFromProps的使用
本文链接:https://www.haomeiwen.com/subject/rvasfctx.html
网友评论