I want to create a custom modal that I can use for multiple actions on the same page, for that I have created a state to store, title, description, and submit function for modal click and modal open state. I also want to take user comments before submitting on the modal, for that I have defined another state text. I passed it inside a modal. when the text inside is changing text state is updated, i also used the same state inside my submit function over there it is not getting reflected. why this is happening?
I want my handleSubmit function to print text added in modal when I click on modal submit.