@@ -75,17 +75,25 @@ export default class Form extends React.Component {
7575 let data = this . state . data ;
7676 let formGroups = [ ] ;
7777
78- if ( this . schema . type === 'array' ) {
79- return getArrayFormRow (
80- data , this . schema , 'rjf' ,
81- this . handleChange , this . addFieldset , this . removeFieldset ,
82- 0
83- ) ;
84- } else if ( this . schema . type === 'object' ) {
85- return getObjectFormRow (
86- data , this . schema , 'rjf' ,
87- this . handleChange , this . addFieldset , this . removeFieldset ,
88- 0
78+ try {
79+ if ( this . schema . type === 'array' ) {
80+ return getArrayFormRow (
81+ data , this . schema , 'rjf' ,
82+ this . handleChange , this . addFieldset , this . removeFieldset ,
83+ 0
84+ ) ;
85+ } else if ( this . schema . type === 'object' ) {
86+ return getObjectFormRow (
87+ data , this . schema , 'rjf' ,
88+ this . handleChange , this . addFieldset , this . removeFieldset ,
89+ 0
90+ ) ;
91+ }
92+ } catch ( error ) {
93+ formGroups = (
94+ < p style = { { color : '#f00' } } >
95+ < strong > (!) Error:</ strong > Schema and data do not match.
96+ </ p >
8997 ) ;
9098 }
9199
0 commit comments