You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed in a list of link previews that the latest item in the list wouldn't have the updated url
is this right? doesn't componentDidUpdate get previous props instead of next props?
componentDidUpdate(nextProps) {
if (nextProps.text !== this.props.text) {
this.getPreview(nextProps.text);
} else if (nextProps.text == null) {
this.setState({isUri: false});
}
}
this works
componentDidUpdate(prevProps) {
if (prevProps.text !== this.props.text) {
this.getPreview(this.props.text);
} else if (this.props.text == null) {
this.setState({isUri: false});
}
}
you're right, componentDidUpdate expect prevprops and not next ones, I'm planning to take a look at older PR to use functional component instead of the current class component, that will be fixed there
I noticed in a list of link previews that the latest item in the list wouldn't have the updated url
is this right? doesn't
componentDidUpdate
get previous props instead of next props?this works
The text was updated successfully, but these errors were encountered: