react
react copied to clipboard
[BUG] documentation - object passed to 'submission' prop must be named 'data'
Environment
Please provide as many details as you can:
The JavaScript docs show an example, but the react docs do not make it obvious that the submission prop needs the object containing the submission values to be named data.
As such, my first thought was to just pass my submission key/values like:
submission={formAnswers.customFields}
Unfortunately, this also compounded the issue as it appears the react component mutates the passed in object as opposed to making a copy to work with internally.
All in all, just adding clarity arouund the expected object shape needing to look like this:
submission={{ data: formAnswers.customFields }}
Would have saved me some headache this morning (:
- Hosting type
- [x] Form.io
- [ ] Local deployment
- Version:
- Formio.js version: "@formio/react": "^5.2.1", "formiojs": "^4.14.6",
- Frontend framework: "react": "^16.8.6",