I am trying to understand a js shortand which came up to me studying React.
This is it: {this.state.isModalOpen && <div className="modal onClose={this.handleClose}">
I simplified for the sake of understanding.
In the state object I have isModalOpen set to true and handleClose is a method which toggle the isModalOpen to true or false when triggered. I understand what it does but I don't understand but what would be a more declarative way to write it to understand where it comes from?
I can write the whole class if needed, but I think it is a pretty newbie question.
Thanks!