Skip to content

Commit

Permalink
Update PlaceholderComponent.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
jason-appliedis committed Jan 22, 2020
1 parent 9c97193 commit 4035e90
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/controls/placeholder/PlaceholderComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,17 @@ export class Placeholder extends React.Component<IPlaceholderProps, IPlaceholder
* @param nextState
*/
public shouldComponentUpdate(nextProps: IPlaceholderProps, nextState: IPlaceholderState): boolean {
/*
* compare the props object for changes in primative values
* Return/re-render, bexeting the function, if the props change
*/
for (const property in nextProps) {
if (property != '_onConfigure'){
if (nextProps[property] != this.props[property]) {
return true;
}
}
}
return this.state.width !== nextState.width || this.props.hideButton !== nextProps.hideButton;
}

Expand Down

0 comments on commit 4035e90

Please sign in to comment.