We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pure利用shouldUpdate的shallowEqual来确定组件是否更新,它是一个对象浅比较
pure
shouldUpdate
shallowEqual
pure: HigherOrderComponent
const { compose, pure, shouldUpdate, lifecycle } = Recompose; const Foo = compose( pure, shouldUpdate((props, nextProps) => props.title !== nextProps.title) , )(({ title }) => ( <div>{console.log('render')}{title}</div> ))
在codepen在线预览
可以结合recompose shouldUpdate来做自定义的props比较
recompose shouldUpdate
props
The text was updated successfully, but these errors were encountered:
No branches or pull requests
pure 介绍
pure
利用shouldUpdate
的shallowEqual
来确定组件是否更新,它是一个对象浅比较pure Flow Type
pure 例子
在线DEMO
在codepen在线预览
备注
可以结合
recompose shouldUpdate
来做自定义的props
比较The text was updated successfully, but these errors were encountered: