I have a Login component in my header(bootstrap) which needs to open a Modal when I click. I am using the Modal from react-modal (npm package). Even though I am not getting an error the popup won't open.
this.state={
openModal:false
}
closeModal=()=>{
this.setState({openModal:false})
}
handleOnClick=()=>{
this.setState({openModal:true}
}
Header Component
` <ul className="nav navbar-nav navbar-right">
<li onClick={this.handleOnClick()}><a href="#">
<Modal
isOpen={this.state.openModal}
onRequestClose={this.closeModal}
style={customStyles}
contentLabel="Example Modal"
>
<span class="glyphicon glyphicon-user"></span></Modal> Sign Up</a></li>
<li><a href="#"><span class="glyphicon glyphicon-log-in"></span> Login</a></li>
</ul>`