form icon indicating copy to clipboard operation
form copied to clipboard

React 17 type issue on form.Field and form.Subscribe

Open DevTGhosh opened this issue 9 months ago • 2 comments

Describe the bug

Getting this issue for the jsx components in react 17

Type 'ReactNode' is not assignable to type 'ReactElement<any, any> | null'. Type 'undefined' is not assignable to type 'ReactElement<any, any> | null'.

Your minimal, reproducible example

https://codesandbox.io/p/devbox/fklwm9

Steps to reproduce

  1. Create a react 17 project
    "react": "^17.0.1",
    "react-dom": "^17.0.1"
    "@types/react": "^17.0.1",
    "@types/react-dom": "^17.0.1"

  1. Use the simple form example
  2. <form.Field> will throw the above ts error

Expected behavior

Expect the ts error to not be there and for react 17 to be supported.

How often does this bug happen?

Every time

Screenshots or Videos

No response

Platform

  • Every system. Reproducible example in codesandbox.

TanStack Form adapter

None

TanStack Form version

v1.1.0

TypeScript version

No response

Additional context

No response

DevTGhosh avatar Mar 18 '25 11:03 DevTGhosh

Any news about this?

ben-heimberg avatar Apr 08 '25 16:04 ben-heimberg

i have the same problem, doesn't work with react 17 types atm

kikoane avatar Apr 15 '25 19:04 kikoane

Same error on react 18.2.0

abritov avatar Jul 11 '25 08:07 abritov

I have the same problem, doesn't work with react 17 types

ThieryMichel avatar Sep 29 '25 13:09 ThieryMichel

I have the same issue

mkrell avatar Oct 06 '25 19:10 mkrell

Me too. I have the same issue.

eriknodland avatar Oct 28 '25 13:10 eriknodland

Sorry for the delay! It looks like the peerDeps need to be checked.

Related: #1829 #1828

LeCarbonator avatar Oct 30 '25 10:10 LeCarbonator