Skip to content

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

@DevTGhosh

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions