Skip to content

docs(react): add reference page for useTransform#2087

Open
mixelburg wants to merge 1 commit intoTanStack:mainfrom
mixelburg:docs/usetransform-reference
Open

docs(react): add reference page for useTransform#2087
mixelburg wants to merge 1 commit intoTanStack:mainfrom
mixelburg:docs/usetransform-reference

Conversation

@mixelburg
Copy link

@mixelburg mixelburg commented Mar 20, 2026

Fixes #2075

The useTransform hook is referenced in docs/config.json and linked from the SSR guide, but the file docs/framework/react/reference/functions/useTransform.md was missing — causing the API reference link to redirect to the framework root page.

This adds the missing reference page with:

  • Type signature matching the actual implementation in the meta-framework adapter packages
  • Description of parameters and return value
  • A usage example
  • Notes clarifying which packages export this hook and a link to the full SSR guide

Summary by CodeRabbit

  • Documentation
    • Added documentation for the useTransform() hook, including usage examples and SSR integration guidance.

@coderabbitai
Copy link

coderabbitai bot commented Mar 20, 2026

📝 Walkthrough

Walkthrough

Added a new documentation page for the useTransform() React hook at docs/framework/react/reference/functions/useTransform.md. The documentation includes the TypeScript signature, parameter descriptions, return type, usage example, and notes on where the hook is exported from adapter packages.

Changes

Cohort / File(s) Summary
useTransform Documentation
docs/framework/react/reference/functions/useTransform.md
New documentation page defining useTransform(fn, deps?) hook for SSR meta-framework adapters, including TypeScript signature, parameters, return type, usage example, and links to SSR guide and implementation source.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Poem

🐰 A hook once lost in the digital maze,
Now documented in shining phase!
useTransform emerges from the dark,
Guiding SSR with a reference spark ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The PR description clearly explains the fix, references the linked issue (#2075), and details the content added. However, the description template's required checklist is not completed. Complete the checklist items (Contributing guide confirmation and pnpm test:pr confirmation) and indicate whether this is docs-only or requires a changeset.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'docs(react): add reference page for useTransform' accurately and concisely describes the main change in the PR—adding a missing documentation page for the useTransform hook.
Linked Issues check ✅ Passed The PR successfully addresses issue #2075 by adding the missing useTransform reference page with type signature, parameter descriptions, usage example, and notes about exporting packages.
Out of Scope Changes check ✅ Passed All changes are limited to adding the missing useTransform.md documentation file, which is directly in scope for resolving issue #2075 about the missing reference page.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/framework/react/reference/functions/useTransform.md`:
- Around line 21-25: The docs mention calling mergeForm(baseForm, serverState)
but don't state its import source; update the useTransform documentation to
explicitly note that mergeForm is exported from `@tanstack/form-core` (e.g.,
"import { mergeForm } from '@tanstack/form-core'") and clarify that it is not
provided by adapter packages, referencing the function name mergeForm and the
hook useTransform to help locate the text to change.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1e9f2513-e51b-48ad-9d2f-e767cc757914

📥 Commits

Reviewing files that changed from the base of the PR and between e21cc01 and 650f30a.

📒 Files selected for processing (1)
  • docs/framework/react/reference/functions/useTransform.md

Comment on lines +21 to +25
### fn

`(formBase: AnyFormApi) => AnyFormApi`

A function that receives the base form API and returns a transformed form API. Typically calls `mergeForm(baseForm, serverState)` to layer server validation errors or default values on top of the client form.
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Verify that mergeForm is exported from adapter packages

# Search for mergeForm exports in adapter packages
echo "=== Searching for mergeForm in react-form-start ==="
fd -t f -e ts -e tsx . packages/react-form-start --exec rg -n "export.*mergeForm"

echo -e "\n=== Searching for mergeForm in react-form-nextjs ==="
fd -t f -e ts -e tsx . packages/react-form-nextjs --exec rg -n "export.*mergeForm"

echo -e "\n=== Searching for mergeForm in react-form-remix ==="
fd -t f -e ts -e tsx . packages/react-form-remix --exec rg -n "export.*mergeForm"

echo -e "\n=== Searching for mergeForm definition ==="
rg -n "function mergeForm|const mergeForm|export.*mergeForm" --type ts

Repository: TanStack/form

Length of output: 387


Clarify the import source for mergeForm in the documentation.

The description references mergeForm(baseForm, serverState) but does not specify where to import it from. mergeForm is exported from @tanstack/form-core, not from the adapter packages. Update the documentation to clearly indicate the correct import source to prevent user confusion.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/framework/react/reference/functions/useTransform.md` around lines 21 -
25, The docs mention calling mergeForm(baseForm, serverState) but don't state
its import source; update the useTransform documentation to explicitly note that
mergeForm is exported from `@tanstack/form-core` (e.g., "import { mergeForm } from
'@tanstack/form-core'") and clarify that it is not provided by adapter packages,
referencing the function name mergeForm and the hook useTransform to help locate
the text to change.

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.

Missing docs for the useTransform function

1 participant