Question: Embedding a 'react jsonschema' form inside another form
See original GitHub issueI’ve been going over the docs and so far haven’t seen an obvious answer here, so I would like to just ask: How do you embed this <Form> into a normal <form> and override simple things like the ‘Submit’ button?
Obviously you can create a CustomForm
like in the docs, but the submit button still comes along for the ride.
It would be great to have a way to break down the JSON schema into its component parts rather than having it try to handle everything
i.e.
const JsonEditorDemo = () => {
const schemaForm = useJsonSchema({ schema, formData });
return <form onSubmit={e => ...schemaForm.data }>
... your other custom form fields can go here, or you can use Formik, etc..
<schemaForm.Editor />
<button>submit</button>
</form>
};
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:8 (1 by maintainers)
Top Results From Across the Web
Dependencies - react-jsonschema-form documentation
Dependencies can be used to create dynamic schemas that change fields based on what data is entered. Property dependencies¶. This library supports conditionally ......
Read more >react-jsonschema-form nested object fields on different levels
I would like to implement a form where each subfield/sub-object of a parent object is indented slightly more than its parent. Consider clicking ......
Read more >lb-react-jsonschema-form - npm
A simple React component capable of building HTML forms out of a JSON schema.. Latest version: 1.2.1, last published: 3 years ago.
Read more >Understanding JSON Schema
representing information about a person in JSON in different ways: ... a declarative format for “describing the structure of other data”.
Read more >Create forms using the JSON Schema Form component
The JSON Schema Form component is based on the react-jsonschema-form library. You create a form by defining the inputs and behavior using JSON...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You can override the submit button by passing something as a child to the
<Form>
component.Interesting idea you bring up – but how do you think it would handle things like validation errors? For example, how would we display validation errors if we had formik embedded within rjsf?
Trying to do this as well (with Formik). I think it would be nice to just have the code to validate/retrieve the values out of the form programmatically without doing a
submit
. Then if my primary form is submitted, I can just programmatically call the JSON form to validate/capture theformData
and deal with it as I like.FWIW: I was not able to get programmatic
submit
to work at all (using MUI JSON form and Formik).