how to pass values to Alert Dialog onConfirm function #1547
-
This may not be a Paste component question, but any advice/example is helpful. I have a event and triggering the event will open the Alert Dialog, when confirming on the Alert Dialog , I wanna run my function using the event.value. However, not able to find a way to pass the direct event.value to the defined onConfirm function. Thinking maybe need to wrap functions. It will be something like Event => open the Alert Dialog => use the Event.value inside onConfirm function. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hi @ycaoT could you share a code sample via CodeSandbox? Thanks! |
Beta Was this translation helpful? Give feedback.
-
Hi @ycaoT. Thanks for sharing the CodeSandbox. I've made some edits, and added a way to pass the input value. Basically I'm using state to store the value, and then retrieving the state of value in the the confirmation function. |
Beta Was this translation helpful? Give feedback.
Hi @ycaoT. Thanks for sharing the CodeSandbox. I've made some edits, and added a way to pass the input value. Basically I'm using state to store the value, and then retrieving the state of value in the the confirmation function.
https://codesandbox.io/s/loving-dust-0ghed?file=/src/App.js