Form
Forms are simple and require almost no work to set up. Simply create an object with the form fields you need and pass it to the <Form>
component. You can render any input type you need – from text boxes to pickers and sliders.
Preview
Code
Props
Form Object
When constructing a form object, the outer key is the input name which is assigned an object with any combination of input props.
Input Props
Form Submission
When your form is submitted to the server, Gravity will optimise the request and only send the name/value pairs, so on the server you can access a value using:
Form Errors
To show an error on a specific form input, throw an error on the server with an inputError
key and the input name.
Last updated