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 = ({
121121 descriptionProps,
122122 buttonGroupProps,
123123 buttonsProps,
124+ alertProps,
125+ BeforeError,
124126 ...rest
125127} ) => {
126128 const {
@@ -137,6 +139,14 @@ const FormTemplate = ({
137139 { description && < Description { ...descriptionProps } > { description } </ Description > }
138140 </ Header >
139141 ) }
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+ ) }
140150 { formFields }
141151 { showFormControls && (
142152 < FormSpy >
@@ -174,7 +184,9 @@ FormTemplate.propTypes = {
174184 titleProps : PropTypes . object ,
175185 descriptionProps : PropTypes . object ,
176186 buttonGroupProps : PropTypes . object ,
177- buttonsProps : PropTypes . object
187+ buttonsProps : PropTypes . object ,
188+ BeforeError : PropTypes . elementType ,
189+ alertProps : PropTypes . object
178190} ;
179191
180192FormTemplate . defaultProps = {
You can’t perform that action at this time.
0 commit comments