Skip to content

Commit

Permalink
Make form submission example clearer (#736)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
wasabigeek authored and glasserc committed Nov 9, 2017
1 parent 775bd59 commit a8b77b9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ WARNING: If you have situations where your parent component can re-render, make
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:

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

render((
<Form schema={schema}
Expand Down

0 comments on commit a8b77b9

Please sign in to comment.