final-form / final-form/react-final-form
Next.js hot reloads keeps dynamic checkbox data stored, but should be reseted
- Dominant language
- JavaScript
- Stars
- 7.4k
- Forks
- 497
- PR merge metrics
- No merged PRs in 30d
Description
### Are you submitting a **bug report** or a **feature request**?
Bug report
### What is the current behavior?
Using final form with next.js and tried to use dynamic checkbox, where new checkboxes will appear based on a list of posts data.
When I check the checkboxes, it gets stored into the values.
```
(
Delete multiple
{posts.map((post, index) => {
return (
{({ input, meta }) => {
return (
{
input.onChange(e); //final-form's onChange
}}
/>
);
}}
);
})}
)}
/>
```
Right now, if I make a quick change, and when nextjs hot reloads, the checked items are still stored in the values, so when you're rechecking the same checkboxes, it'll add to the values from the previous checkbox.
### What is the expected behavior?
When nextjs hot reloads, the data value of the checkbox should reset.
Contributor guide
Assessment
This issue has not been assessed yet.