Update HeroWebpart.tsx

Fix SetState loop
This commit is contained in:
Omar 2021-07-29 16:14:36 +01:00
parent 9572960ff6
commit 0a5f66ca91
1 changed files with 1 additions and 1 deletions

View File

@ -71,7 +71,7 @@ export default class HeroWebpart extends React.Component<IHeroWebpartProps, IHer
public componentDidUpdate(prevProps : IHeroWebpartProps, prevState : IHeroState) : void
{
// If properties have changed bind it and update webpart
if(this.props.items !== prevProps.items || this.state.items !== prevState.items)
if(this.props.items !== prevProps.items)
{
this.setState({items:this.props.items});
if(this.props.showAllHero){