-
Notifications
You must be signed in to change notification settings - Fork 107
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
The form value is out of sync if we are dispatching multiple intents in a row #400
Comments
@Pouet-- Let's move the discussion here. The issue you see will be resolved if you identify the child type with childFieldset.type.initialValue === TreeNodeType.LOGIC
childFieldset.type.initialValue === TreeNodeType.FILTER The issue is that Conform's value get out of sync and mess up if you dispatch more than one intents in one callback. Definitely something I need to look into further. 😅 Thanks again for preparing the repo! |
I changed parts of my code since v1 is released to use |
For information, I hacked this problem with the following : flushSync(() => {
form.insert({ name: ..., defaultValue: ... });
});
flushSync(() => {
form.remove({ name: ..., index: ... });
}); It waits for a re-render before launching the second operation, so the values are correctly filled, but this triggers 2 re-renders |
In v1.0.3, Conform has all form intents wrapped in a flush sync already so there is no need to wrap it yourself. |
Hi, @edmundhung. I'd argue conform wrap form intent (maybe I should say wrap programatic for intent) is not a good decision. Maybe state One significant drawback wrapping every form intent with |
Describe the bug and the expected behavior
Originally reported by @Pouet-- on #331 (reply in thread)
Conform version
v1.0.0-rc.1
Steps to Reproduce the Bug or Issue
What browsers are you seeing the problem on?
No response
Screenshots or Videos
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: