Open sibbl opened 5 years ago
I currently have troubles with switching an icon depending on whether a menu is open.
Neither
<MaterialIcon icon={this.state.isOpen ? "close" : "add"}/>
nor
{ this.state.isOpen ? <MaterialIcon icon="close" /> : <MaterialIcon icon="add" /> }
work properly. The icon is never updated in the DOM.
The only workaround is to use the key attribute, but I'd expect this to work out of the box using componentDidUpdate.
key
componentDidUpdate
Is this planned to be up soon ?
I currently have troubles with switching an icon depending on whether a menu is open.
Neither
<MaterialIcon icon={this.state.isOpen ? "close" : "add"}/>
nor
{ this.state.isOpen ? <MaterialIcon icon="close" /> : <MaterialIcon icon="add" /> }
work properly. The icon is never updated in the DOM.
The only workaround is to use the
key
attribute, but I'd expect this to work out of the box usingcomponentDidUpdate
.