form icon indicating copy to clipboard operation
form copied to clipboard

Fast refresh not working with HOC (withForm)

Open bitabs opened this issue 1 month ago • 7 comments

Describe the bug

I noticed that no one has raised this before, but if you try to use withForm HOC form composition, you lose the fast-refresh:

Could not Fast Refresh ("SomeComponent" export is incompatible). Learn more at https://github.com/vitejs/vite-plugin-react/tree/main/packages/plugin-react#consistent-components-exports

Your minimal, reproducible example

tanstack-form

Steps to reproduce

  1. Create a component that uses withForm
  2. Edit file
  3. Check the app

Expected behavior

As a developer, when I edit file with withForm HOC, the app should fast refresh.

How often does this bug happen?

None

Screenshots or Videos

No response

Platform

  • OS: Mac
  • Browser: Chrome

TanStack Form adapter

react-form

TanStack Form version

v1.23.8

TypeScript version

No response

Additional context

No response

bitabs avatar Nov 23 '25 19:11 bitabs

@bitabs Please assign me this issue

id-87 avatar Nov 24 '25 04:11 id-87

@id-87 I don't have permission to assign you for some reason

bitabs avatar Nov 24 '25 07:11 bitabs

So should I work on it and raise a pr for now @bitabs ?

id-87 avatar Nov 24 '25 10:11 id-87

If you have a proposed solution for it, feel free to open a PR for this issue @id-87

LeCarbonator avatar Nov 24 '25 10:11 LeCarbonator

Sure mate @id-87 I just came across this bug when using it. Feel free to open a PR

bitabs avatar Nov 25 '25 11:11 bitabs

@LeCarbonator Mind assigning @id-87 to this issue?

bitabs avatar Nov 25 '25 11:11 bitabs

Not sure why that's needed, but if you'd like it, sure.

LeCarbonator avatar Nov 26 '25 16:11 LeCarbonator