Closed jeffreycwitt closed 2 years ago
It seems that most cases could be solved by switching to componentDidUpdate
For example
from this:
UNSAFE_componentWillReceiveProps(newProps){
if (newProps.transcriptionid !== this.props.transcriptionid){
this.setState({versions: []}, () => {
this.getVersionHistory(newProps.transcriptionid)
})
}
}
to this
componentDidUpdate(prevProps, prevState){
if (this.props.transcriptionid !== prevProps.transcriptionid){
console.log('running fetch')
this.setState({versions: []}, () => {
this.getVersionHistory(this.props.transcriptionid)
})
}
Basically done. Couple of instances lingering in used components
done I think.
update all UNSAFE lifecycle methods