File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
packages/common/src/form-template Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -121,6 +121,8 @@ const FormTemplate = ({
121
121
descriptionProps,
122
122
buttonGroupProps,
123
123
buttonsProps,
124
+ alertProps,
125
+ BeforeError,
124
126
...rest
125
127
} ) => {
126
128
const {
@@ -137,6 +139,14 @@ const FormTemplate = ({
137
139
{ description && < Description { ...descriptionProps } > { description } </ Description > }
138
140
</ Header >
139
141
) }
142
+ { BeforeError && (
143
+ < FormSpy subscription = { { submitError : true , error : true } } >
144
+ { ( ) => {
145
+ const state = getState ( ) ;
146
+ return < BeforeError formError = { state . error || state . submitError } formSpyProps = { state } alertProps = { alertProps } /> ;
147
+ } }
148
+ </ FormSpy >
149
+ ) }
140
150
{ formFields }
141
151
{ showFormControls && (
142
152
< FormSpy >
@@ -174,7 +184,9 @@ FormTemplate.propTypes = {
174
184
titleProps : PropTypes . object ,
175
185
descriptionProps : PropTypes . object ,
176
186
buttonGroupProps : PropTypes . object ,
177
- buttonsProps : PropTypes . object
187
+ buttonsProps : PropTypes . object ,
188
+ BeforeError : PropTypes . elementType ,
189
+ alertProps : PropTypes . object
178
190
} ;
179
191
180
192
FormTemplate . defaultProps = {
You can’t perform that action at this time.
0 commit comments