0

//Calling props value inside componentDidMountHere i am able to access the value of others but when i access widget.data i got indefined

componentDidMount(){
        const widget = this.props.widgets.filter(widget => widget.id === this.state.widgetId)[0];  
       console.log('object',widget);
       console.log('widget.description---',widget.description);
       console.log('widget.code-------',widget.code);
       console.log('widget.componentName----',widget.componentName)
    
       console.log('widget.data',widget.Data);
      }
      

1 Answers1

1

Properties in JavaScript are case-sensitive. Therefore, you have to use widget.data instead of widget.Data.

lukasl-dev
  • 724
  • 3
  • 11