aidenybai / million

Optimize React performance and make your React 70% faster in minutes, not months.
https://million.dev
MIT License
15.87k stars 554 forks source link

Does not work with `react-hook-form` in auto mode #1032

Open EmmettM opened 1 month ago

EmmettM commented 1 month ago

What version of million are you using?

3.0.6

Are you using an SSR adapter? If so, which one?

None

What package manager are you using?

npm

What operating system are you using?

Mac

What browser are you using?

Chrome

Describe the Bug

When using Million and react-hook-form, form state does not update on input.

Adding //million-ignore fixes the issue, so it's Million.

What's the expected result?

The form state should be in line with the input values

Link to Minimal Reproducible Example

https://stackblitz.com/edit/vitejs-vite-47doxe?file=src%2FApp.tsx

Participation

github-actions[bot] commented 1 month ago

Thanks for opening this issue! A maintainer will review it soon.

tobySolutions commented 1 month ago

Thank you for sharing this. The team is actively working to knock out things like these in the upcoming release 😁. Thank you!!

barrcodes commented 1 month ago

I'm also having issues, but mine are slightly different. When I open the form, I get Error: Invalid hook call. Hooks can only be called inside of the body of a function component. in the component code of one of my form fields. I've attempted // million-ignore at the top of the file, but it appears to have no effect. I have also tried to exclude all files related to the form via the million plugin filter config.

million 3.1.6 @million/lint 1.0.0-rc.12

This appears to be lint related, as it works fine when I remove the linter from my config.

vadolasi commented 4 weeks ago

Same where