Repository URL to install this package:
Version:
0.14.1 ▾
|
// @file @todo - rename <FormState>
import React from 'react'
import { FormState, toInputState } from 'src/forms'
// @todo - the rest
const list = [
{
identity: 'eh',
name: 'eh',
className: 'canada-eh',
type: 'text',
value: '',
animatePlaceholder: true,
isLabelOnTop: false,
placeholderText: 'eh',
maxLength: '50',
validationType: 'required',
errorMessageFor: 'eh',
},
]
// import direct, or the fn
// const observableList = list.map(FormState.toInputState)
const observableList = list.map(toInputState)
class ExampleFormState extends FormState {
// name = 'example'
// can set like this, or with the method
// inputsList = observableList
}
const exampleFormState = new ExampleFormState()
exampleFormState.setInputsList(observableList)
export { exampleFormState, ExampleFormState }
export default exampleFormState