Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public componentDidUpdate(prevProps: ITaxonomyPickerProps): void {
// Check if the initial values objects are not equal, if that is the case, data can be refreshed
if (!isEqual(this.props.initialValues, prevProps.initialValues)) {
this.setState({
activeNodes: this.props.initialValues || []
});
}
}
public componentWillUpdate(nextProps: IPropertyFieldOrderHostProps): void {
// Check if the provided items are still the same
if (!isEqual(nextProps.items, this.state.items)) {
this.setState({
items: this.props.items || []
});
}
}
userFavoriteLinks.forEach(userLink => {
let linkMatch = find(allFavoriteLinks, (favoriteLink => favoriteLink.id === userLink.id));
if (linkMatch && (!isEqual(linkMatch.url, userLink.url) || !isEqual(linkMatch.displayText, userLink.displayText) || !isEqual(linkMatch.icon, userLink.icon))) {
shouldUpdate = true;
personalLinks.push(linkMatch);
} else {
personalLinks.push(userLink);
}
});
userFavoriteLinks.forEach(userLink => {
let linkMatch = find(allFavoriteLinks, (favoriteLink => favoriteLink.id === userLink.id));
if (linkMatch && (!isEqual(linkMatch.url, userLink.url) || !isEqual(linkMatch.displayText, userLink.displayText) || !isEqual(linkMatch.icon, userLink.icon))) {
shouldUpdate = true;
personalLinks.push(linkMatch);
} else {
personalLinks.push(userLink);
}
});
if (shouldUpdate) {
public componentWillUpdate(nextProps: IPeoplePickerProps, nextState: IPeoplePickerState): void {
if (!isEqual(this.props.defaultSelectedUsers, nextProps.defaultSelectedUsers) ||
this.props.groupName !== nextProps.groupName ||
this.props.webAbsoluteUrl !== nextProps.webAbsoluteUrl ||
this.peopleSearchService.getSumOfPrincipalTypes(this.props.principalTypes) !== this.peopleSearchService.getSumOfPrincipalTypes(nextProps.principalTypes)) {
this.getInitialPersons(nextProps);
}
}
public componentWillReceiveProps(nextProps: IDateTimePickerProps): void {
if (nextProps.value != null && !isEqual(nextProps.value, this.props.value)) {
const { day, hours, minutes, seconds } = DateTimePicker.getDateComponents(nextProps.value, this.props.dateConvention);
this.setState({ day, hours, minutes, seconds });
}
}
public componentWillUpdate(nextProps: IMapProps, nextState: IMapState): void {
if (!isEqual(this.props.coordinates, nextProps.coordinates)) {
this.setState({
coordinates: this.props.coordinates
});
}
}