8/1/2022 9:52:35 PM

Add a simple JavaScript confirmation popup on a button in React.


<button type="button" onClick={() => { if (window.confirm('Are you sure?')) { this.delete_obj(this.props.id); } }}>Delete Object</button>