What you’ll learn
- How to inspect current form data and validation state
- How to trace validation errors to specific fields
- How to diagnose JSON schema problems (missing components, wrong type names)
- How to debug conditional logic, actions, and events
- A step-by-step diagnostic checklist for “my form doesn’t work” scenarios
Inspect current form data
The most common debugging task is checking: “What data does my form actually have right now?” Use theonFormDataChange callback to log form state every time it changes:
dataobject: does it contain all your fields with the correct keys?errorsobject: which fields have validation errors? Are they the fields you expect?- Are keys spelled correctly (case-sensitive)? A field with
key: "userName"will show asuserNamein data, notusername.
Trace validation errors
When a form doesn’t submit and you see “validation failed” but can’t find which field is wrong, usegetValidationResult():
getValidationResult() to see ALL errors regardless of touch state.
Debug JSON schema issues
If a form doesn’t render or some fields disappear, the problem is usually in your JSON schema.Component type not found
The most common issue: wrong component type name. FormEngine doesn’t throw an error when atype doesn’t exist — it silently skips the component. Check your browser console for warnings:
| Package | Text input | Dropdown | Checkbox | Wizard |
|---|---|---|---|---|
| RSuite | RsInput | RsDropdown | RsCheckbox | RsWizard ✅ |
| Material UI | MuiTextField | MuiSelect | MuiCheckbox | ❌ |
| Mantine | MtTextInput | MtSelect | MtCheckbox | ❌ |
- Open your browser DevTools Console (F12 → Console tab)
- Look for
[FormEngine]warnings - Cross-check your
typevalues against the package you installed - Common typos:
RsInputnotRsTextInputorRsTextFieldRsDropdownnotRsSelectorRsSelectPickerMuiTextFieldnotMuiInputorTextField
Verify keys match your data
A common source of confusion: keys must match exactly, and they’re case-sensitive.- Print your schema to console and verify all
keyvalues - Print your form data and check that keys match exactly
- Compare key casing character-by-character
Debug actions and events
If a button click doesn’t trigger your function, the problem is usually in the action definition or event binding.actionNamedoesn’t match the action’sname→ action never runs- Action not included in the
actionsarray passed to<FormViewer />→ action not found - Action function throws an error → check browser console for stack trace
console.log at the top of your functionalAction function to confirm it’s being called.
Debug conditional logic
Conditional rendering (renderWhen) can silently fail if field keys or expressions are wrong.
- Print your schema and verify
fieldKeymatches a field’skeyexactly (case-sensitive) - Test the expression in browser console:
- Check that the field you’re referencing has rendered before (appears earlier in children array)
false. Check:
- Is the referenced field’s value what you expect?
- Is the operator correct? (
===for strings, not==) - Is the quoted value correct? (
"company"notcompany)
Performance debugging
If your form is slow or re-renders too much, use React DevTools Profiler:- Open React DevTools (Chrome Extension)
- Go to Profiler tab
- Click Record, interact with your form, click Stop
- Look for excessive re-renders of
<FormViewer />component
onFormDataChange callback is defined inline, causing re-render on every keystroke.
Fix — use useCallback:
Diagnostic flowchart: “My form doesn’t work”
Follow this checklist step-by-step:Form doesn’t render at all
- ✅ Check: Is
<FormViewer />component imported and mounted? - ✅ Check: Is
formprop a valid JSON string? Try:const form = JSON.stringify({...}) - ✅ Check: Does your schema have a root object with
type: 'Form'? - ✅ Check: Is
viewprop passed? Example:view={view}from your UI library - Debug:
console.log(schema)to see raw JSON, paste in JSON validator
Fields don’t appear
- ✅ Check: Does the schema have a
childrenarray? - ✅ Check: Are all type names correct? Open DevTools Console, look for
[FormEngine] Unknown component typewarnings - ✅ Check: Is the component installed? Example: did you
npm install @react-form-builder/components-rsuite? - Debug: Log schema to console, cross-check type names against package docs
Form renders but data isn’t captured
- ✅ Check: Does each field have a unique
key? - ✅ Check: Is the key you’re reading the same case as the schema key?
- ✅ Check: Is
onFormDataChangecallback defined? Add console.log to see if it fires - Debug:
console.log(form.getData())to see what data exists
Validation doesn’t work
- ✅ Check: Is
validationsarray present on the field? - ✅ Check: Is
errorTypeset to"error"or"warning"? - ✅ Check: Are validation conditions correct? Example:
min: 18notmin: "18"(number, not string) - ✅ Check: Has the field been touched? Call
getValidationResult()to see all errors regardless - Debug:
console.log(getValidationResult())to see all validation errors
Button click doesn’t work
- ✅ Check: Is the field type correct? Should be
RsButton,MuiButton, orMtButton - ✅ Check: Does the field have an
eventsarray? - ✅ Check: Is
eventNamespelled correctly? Usually"onClick" - ✅ Check: Is
actionNameregistered? Pass action toactionsprop:<FormViewer actions={[myAction]} /> - ✅ Check: Does action
namematchactionNamein events? - Debug: Add
console.loginside your action function to confirm it’s called
Form shows old data
- ✅ Check: Did you update
initialDataprop? - ✅ Check: Did you pass
keyprop to<FormViewer />to force re-mount? Example:key={resetCounter} - Debug:
console.log('Rendering with initial data:', initialData)
Common mistakes
| Mistake | Symptom | Fix |
|---|---|---|
| Field type doesn’t exist | No error, field silently missing | Check DevTools Console, correct type name |
| Key mismatch (case) | data.userName is undefined | Use exact case: userName not username |
| Action not registered | Button clicked, nothing happens | Pass action to actions prop |
| Action name typo | Button doesn’t trigger | Ensure actionName === action’s name |
Missing children array | Form renders but no fields | Add children: [...] to schema |
| Wrong validation type | ”min 18” doesn’t work on age field | Use correct validation: { type: 'min', value: 18 } |
| Field always hidden | renderWhen field never appears | Check expression is truthy, field key matches |
| Form data undefined | getData() returns undefined | Call after fields render, check getForm() returns form instance |
Next steps
Validation & Error Handling
Deep dive into validation rules, custom validators, and error messages.
Conditional Fields & Logic
Master renderWhen, conditional validation, and dynamic form logic.
Form Submission & Actions
Handle form submission, server errors, and custom actions.
Form Data Handling
Handle form data, initial values, and form state management.