-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
flushSync was called from inside a lifecycle method #512
Comments
I am doing further testing, but it appears the form.reset() may not be needed anymore.... I had to do this in earlier version of conform to have the detail section update. I will do more testing and see if this can be removed going forwards. |
OK after some quick testing, yes I do have to use form.reset() in a useEffect as the form isn't being reloaded, rather the data being updated. |
Thanks for reporting. This looks like a bug from #496. I will revert it. |
I have published v1.0.4 with the problematic changes reverted for now. |
Thanks mate, thank you so much for your work, and the recent ShadCN examples were perfect as well.
From: Edmund Hung ***@***.***>
Date: Tuesday, 12 March 2024 at 6:40 am
To: edmundhung/conform ***@***.***>
Cc: Jason Coley ***@***.***>, Author ***@***.***>
Subject: Re: [edmundhung/conform] flushSync was called from inside a lifecycle method (Issue #512)
I have published v1.0.4<https://github.com/edmundhung/conform/releases/tag/v1.0.4> with the problematic changes reverted for now.
—
Reply to this email directly, view it on GitHub<#512 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AA5NTOBOGMSM5A6KU63CRGLYXYJDHAVCNFSM6AAAAABEPZEMQOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOBZGQYDGNZWGY>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Describe the bug and the expected behavior
This error is appearing in 1.0.3
Conform version
v1.0.3
Steps to Reproduce the Bug or Issue
useEffect(() => {
form.reset()
}, [formData]) //from useLoaderData()
What browsers are you seeing the problem on?
Chrome
Screenshots or Videos
No response
Additional context
If I wrap the form.reset() in a queueMicrotask the error will go away. The reason I use the formReset is that I have a form as shown below, where the items are selected in the route to the left (the list) and a detail route the right side. Using form.reset() seems to be the best way to have the form update with the newly selected item received in the detail routes useLoaderData
The text was updated successfully, but these errors were encountered: