Skip to content

Commit a8b77b9

Browse files
wasabigeekglasserc
authored andcommitted
Make form submission example clearer (rjsf-team#736)
In the example, the `onSubmit` function receives a `formData` obj. However, the actual data is in `formData.formData`. While this is explained in the docs, I propose making it clearer in the example as well.
1 parent 775bd59 commit a8b77b9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ WARNING: If you have situations where your parent component can re-render, make
201201
You can pass a function as the `onSubmit` prop of your `Form` component to listen to when the form is submitted and its data are valid. It will be passed a result object having a `formData` attribute, which is the valid form data you're usually after:
202202

203203
```js
204-
const onSubmit = ({formData}) => console.log("yay I'm valid!");
204+
const onSubmit = ({form}) => console.log("Data submitted: "+form.formData);
205205

206206
render((
207207
<Form schema={schema}

0 commit comments

Comments
 (0)