File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
types/react-jsonschema-form Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,9 @@ declare module 'react-jsonschema-form' {
56
56
acceptcharset ?: string ;
57
57
}
58
58
59
- export default class Form < T > extends React . Component < FormProps < T > > { }
59
+ export default class Form < T > extends React . Component < FormProps < T > > {
60
+ submit : ( ) => void ;
61
+ }
60
62
61
63
export type UiSchema = {
62
64
'ui:field' ?: Field | string ;
Original file line number Diff line number Diff line change @@ -173,3 +173,15 @@ export const withThemeExample = () => {
173
173
export const additionalPropertyFlagExample = ( ) => {
174
174
return ADDITIONAL_PROPERTY_FLAG ;
175
175
} ;
176
+
177
+ export const ExternalFormSubmissionExample = ( ) => {
178
+ const formRef = React . useRef < Form < any > > ( null ) ;
179
+
180
+ return (
181
+ < Form schema = { schema } ref = { formRef } >
182
+ < button onClick = { formRef . current ? formRef . current . submit : undefined } >
183
+ FancySubmitButton
184
+ </ button >
185
+ </ Form >
186
+ ) ;
187
+ } ;
You can’t perform that action at this time.
0 commit comments