tcomb-form icon indicating copy to clipboard operation
tcomb-form copied to clipboard

How can i make transparent layer for t.struct({})

Open MomenYasser opened this issue 6 years ago • 0 comments

Version

  • tcomb-form v0.9.17.
  • react v15.6.1

Expected behavior

I need to make this Schema:

const schema = t.struct({
	section1: t.struct({
		name: t.String,
		phone: t.Number
	}),
	section2: t.struct({
		email: t.String,
		address: t.String
	})
});

And after submitting the form i'm expecting this value object:

{
	name: 'bla',
	phone: '123456'
	email: '[email protected]',
	address: 'blabla'
}

Actual behavior

{
   section1: {
	name: 'bla',
	phone: '123456'
    },
    section2: {
	email: '[email protected]',
	address: 'blabla'
    }
}

Is there's anyway to make sections transparent Just UI layer ?

Thanks

MomenYasser avatar Mar 20 '18 11:03 MomenYasser