Skip to content

Commit 4ca9370

Browse files
committed
Conditional Fields example
1 parent c9fc296 commit 4ca9370

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ const MyForm = () => (
132132
* [Loading, Normalizing, Saving, and Reinitializing](#loading-normalizing-saving-and-reinitializing)
133133
* [🏎️ Downshift Type-Ahead](#-downshift-type-ahead)
134134
* [Redux Example](#redux-example)
135+
* [Conditional Fields](#conditional-fields)
135136
* [Rendering](#rendering)
136137
* [API](#api)
137138
* [`Field : React.ComponentType<FieldProps>`](#field--reactcomponenttypefieldprops)
@@ -337,6 +338,10 @@ Demonstrates how to use a [🏎️ Downshift](https://github.com/paypal/downshif
337338

338339
The only reason to keep your 🏁 Final Form form data in Redux is if you need to be able to read it from outside your form. This example demonstrates how to use a `FormSpy` to keep a copy of your form data in the Redux store. Note that the canonical authoritative version of the data still lives in 🏁 Final Form. If you need to _mutate_ your data via dispatching Redux actions, you should probably use [Redux Form](https://redux-form.com).
339340

341+
### [Conditional Fields](https://codesandbox.io/s/lm4p3m92q)
342+
343+
Sometimes you might want to conditionally show or hide some parts of your form depending on values the user has already provided for other form inputs. 🏁 React Final Form makes that very easy to do by creating a `Condition` component out of a `Field` component.
344+
340345
## Rendering
341346

342347
There are three ways to tell `<Form/>` and `<Field/>` what to render:

0 commit comments

Comments
 (0)