Skip to content
Source
Sign inSign up
TanStack/form
Open History to see the last commit

debugging.md

17 lines835 Bytes

1---
2id: debugging
3title: Debugging React Usage
4---
5​
6Here's a list of common errors you might see in the console and how to fix them.
7​
8# Changing an uncontrolled input to be controlled
9​
10If you see this error in the console:
11​
12```
13Warning: A component is changing an uncontrolled input to be controlled. This is likely caused by the value changing from undefined to a defined value, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components
14```
15​
16It's likely you forgot the `defaultValues` in your `useForm` Hook or `form.Field` component usage. This is occurring
17because the input is being rendered before the form value is initialized and is therefore changing from `undefined` to `""` when a text input is made.