Fix initial blank load

Fixes error on webpart load when no items are available
This commit is contained in:
Omar 2021-08-04 14:24:49 +01:00
parent 5cb969c19e
commit 9541a7e455
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)
if(this.props.items !== prevProps.items && this.props.items.length!==0)
{
this.setState({items:this.props.items});
if(this.props.showAllHero){