I am trying to use a react icon picker using material-ui-icon-picker
But, I get an assignment to undeclared variable showPickedIcon error
edit( { attributes, className, focus, setAttributes, setFocus, setState } ) {
const { content, alignment ,applyStyles,icon} = attributes;
showPickedIcon = (icon) => {
console.info(icon) // prints {name: "access_alarm", code: "e190"}
}
return (
<MaterialUiIconPicker onPick={this.showPickedIcon} />
);
},
and I can't find how to fix this.
showPickedIconis not defined in the scope. Declare it withconst,letorvarand you won't have that error. Also, refrain from asking such low level questions which can be solved using a good IDE.