Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.
added 285 characters in body
Source Link
Hkrie
  • 127
  • 5
<span className="close" onClick={this.props.onclick}><u>Close</u> X</span> // basically this is what you want no? const onclick = () => { handleClose(); doIsChecked(); }; 

If you need the event then you can pass it from the onclick function to the handleClose or doIsChecked

Update:

Actually the script above is more general. In your case it would probably look like this:

<span className="close" onClick={onclick}><u>Close</u> X</span> 

.

const onclick = () => { this.props.handleClose(); doIsChecked(); }; 
<span className="close" onClick={this.props.onclick}><u>Close</u> X</span> // basically this is what you want no? const onclick = () => { handleClose(); doIsChecked(); }; 

If you need the event then you can pass it from the onclick function to the handleClose or doIsChecked

<span className="close" onClick={this.props.onclick}><u>Close</u> X</span> // basically this is what you want no? const onclick = () => { handleClose(); doIsChecked(); }; 

If you need the event then you can pass it from the onclick function to the handleClose or doIsChecked

Update:

Actually the script above is more general. In your case it would probably look like this:

<span className="close" onClick={onclick}><u>Close</u> X</span> 

.

const onclick = () => { this.props.handleClose(); doIsChecked(); }; 
Source Link
Hkrie
  • 127
  • 5

<span className="close" onClick={this.props.onclick}><u>Close</u> X</span> // basically this is what you want no? const onclick = () => { handleClose(); doIsChecked(); }; 

If you need the event then you can pass it from the onclick function to the handleClose or doIsChecked