Skip to content

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

Closed

Description

@DevTGhosh

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

Activity

  1. ben-heimberg commented on Apr 8, 2025

    @ben-heimberg

    Any news about this?

  2. kikoane commented on Apr 15, 2025

    @kikoane

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

  3. abritov commented on Jul 11, 2025

    @abritov

    Same error on react 18.2.0

  4. ThieryMichel commented on Sep 29, 2025

    @ThieryMichel

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

  5. mkrell commented on Oct 6, 2025

    @mkrell

    I have the same issue

  6. eriknodland commented on Oct 28, 2025

    @eriknodland

    Me too. I have the same issue.

  7. LeCarbonator commented on Oct 30, 2025

    @LeCarbonator
    Contributor

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

    Related:
    #1829
    #1828

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugThis is a bug in behaviour.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions