Skip to content

Instantly share code, notes, and snippets.

@primaryobjects
Created November 1, 2017 19:03
Show Gist options
  • Select an option

  • Save primaryobjects/aacf6fa49823afb2f6ff065790a5b402 to your computer and use it in GitHub Desktop.

Select an option

Save primaryobjects/aacf6fa49823afb2f6ff065790a5b402 to your computer and use it in GitHub Desktop.
A simple example of a confirm alert dialog in ReactJs / React.
<div className='delete-button' onClick={() => { if (window.confirm('Are you sure you wish to delete this item?')) this.onCancel(item) } } />
@sanryuu03
Copy link
Copy Markdown

thank you, this way, worked perfectly with my code! onClick={() => { window.confirm( 'Are you sure you want to delete this Card?', ) && deleteCard(id) }}

thanks. tested Next js "v13.1.6"

@Ginasonia98
Copy link
Copy Markdown

thankyou it's work for me

@OjoJosh7
Copy link
Copy Markdown

Thank you very much, very easy to implement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment