Replies: 1 comment
-
This is resolved |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
<FormViewer
view={DefaultBuilderView()}
getForm={() => myForm}
viewerRef={ref}
initialData={myData}
onFormDataChange={(newData) => {
const originalData = JSON.parse(myData ?? "{}");
const areEqual = deepEqual(originalData, newData.data);
if (!areEqual) {
setIsFormDirty(true);
}
}}/>
I need to show external discard button which will be shown when areEqual is false that is when form is updated by user, it shows discard button but that triggers re rendering of form and I loss the changes made on form viewer on very first time, it works only after discard button is visible i.e. on second try to make changes on form where I don't loose my changes on the form.
Beta Was this translation helpful? Give feedback.
All reactions