Skip to content

Conversation

xotea
Copy link
Contributor

@xotea xotea commented Oct 22, 2025

Fixes: #1815

🎯 Changes

In React JSX.Element is only a subset of the valid children described by ReactNode. By widening this type we allow returning all valid React children now in a non-breaking fashion allowing

withForm({
  // Type 'null' is not assignable to type 'Element'.
  render: function Render() {
    return null
  },
})

withFieldGroup({
  // Type 'null' is not assignable to type 'Element'.
  render: function Render() {
    return null
  },
})

to work without TypeScript errors.

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested this code locally with pnpm test:pr.

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.

@changeset-bot
Copy link

changeset-bot bot commented Oct 22, 2025

🦋 Changeset detected

Latest commit: 7b913e8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@tanstack/react-form Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@nx-cloud
Copy link

nx-cloud bot commented Oct 23, 2025

View your CI Pipeline Execution ↗ for commit 7b913e8

Command Status Duration Result
nx affected --targets=test:sherif,test:knip,tes... ✅ Succeeded 2m 35s View ↗
nx run-many --target=build --exclude=examples/** ✅ Succeeded 6s View ↗

☁️ Nx Cloud last updated this comment at 2025-10-23 08:33:02 UTC

@pkg-pr-new
Copy link

pkg-pr-new bot commented Oct 23, 2025

More templates

@tanstack/angular-form

npm i https://pkg.pr.new/@tanstack/angular-form@1817

@tanstack/form-core

npm i https://pkg.pr.new/@tanstack/form-core@1817

@tanstack/form-devtools

npm i https://pkg.pr.new/@tanstack/form-devtools@1817

@tanstack/lit-form

npm i https://pkg.pr.new/@tanstack/lit-form@1817

@tanstack/react-form

npm i https://pkg.pr.new/@tanstack/react-form@1817

@tanstack/react-form-devtools

npm i https://pkg.pr.new/@tanstack/react-form-devtools@1817

@tanstack/solid-form

npm i https://pkg.pr.new/@tanstack/solid-form@1817

@tanstack/svelte-form

npm i https://pkg.pr.new/@tanstack/svelte-form@1817

@tanstack/vue-form

npm i https://pkg.pr.new/@tanstack/vue-form@1817

commit: 7b913e8

@codecov
Copy link

codecov bot commented Oct 23, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 51.91%. Comparing base (6892ed0) to head (7b913e8).
⚠️ Report is 36 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #1817       +/-   ##
===========================================
- Coverage   90.35%   51.91%   -38.45%     
===========================================
  Files          38       14       -24     
  Lines        1752      183     -1569     
  Branches      444       29      -415     
===========================================
- Hits         1583       95     -1488     
+ Misses        149       77       -72     
+ Partials       20       11        -9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@LeCarbonator LeCarbonator left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also LGTM! The code coverage appears to complain, but this isn't affected by this PR.

@LeCarbonator LeCarbonator merged commit 634facf into TanStack:main Oct 23, 2025
6 of 7 checks passed
@github-actions github-actions bot mentioned this pull request Oct 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Return type of render is unnecessarily strict in withForm and withFieldGroup (React)

2 participants