in component
class xxxx extends React.Component {
...
shouldComponentUpdate(){
if(...){
return true or false
}
}
}
Component only with local imports
import reactAutoUpdate from 'react-auto-update'
@reactAutoUpdate
class xxxx extends React.Component {
...
}
-
Install
npm install react-auto-update --save
-
Add react-auto-update in component top:
@reactAutoUpdate
but this package depend on immutable.js
Done!