We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 6140b26 + 0fc10b1 commit 438a423Copy full SHA for 438a423
src/components/Thumbs.tsx
@@ -70,16 +70,14 @@ export default class Thumbs extends Component<Props, State> {
70
this.setupThumbs();
71
}
72
73
- UNSAFE_componentWillReceiveProps(props: Props) {
74
- if (props.selectedItem !== this.state.selectedItem) {
+ componentDidUpdate(prevProps: Props) {
+ if (this.props.selectedItem !== this.state.selectedItem) {
75
this.setState({
76
- selectedItem: props.selectedItem,
77
- firstItem: this.getFirstItem(props.selectedItem),
+ selectedItem: this.props.selectedItem,
+ firstItem: this.getFirstItem(this.props.selectedItem),
78
});
79
80
- }
81
82
- componentDidUpdate(prevProps: Props) {
83
if (this.props.children === prevProps.children) {
84
return;
85
0 commit comments