I am using Formik for form validation in React application. Parent component (Users) - displays list of users. If we select any user, details of the user will be displayed in another component to the right side in a form. The child component (UserDetails) displays the details of the selected user. All the details are displayed in textboxes in child component, which we can change and update the details(Here I am using FORMIK to validate fields before updating).
I have a scenario where when someone modifies the details in the form and clicks on another user without updating previous edits. In such cases I want to show a prompt stating that "unsaved changes will be lost"