1.0.1 • Published 5 years ago
react-tera-forms v1.0.1
react-forms
Forms for React
Install
npm install --save react-tera-forms
Usage
import React, { Component } from 'react'
import Form, { Validators } from 'react-tera-forms'
class Example extends Component {
render () {
return (
<Form
name='My Form'
onSubmit={this.onSubmit}
config={{
fields: {
name: 'text',
place: {
type: 'text',
validators: Validators.REQUIRED,
},
number: {
type: 'text',
validators: [
Validators.REQUIRED,
Validators.NUMBER,
],
},
home: {
type: 'text',
validators: [
Validators.REQUIRED,
],
renderInput: ({value, onChange}) => (
<textarea name='Home' value={value} onChange={(event) => onChange('home', event.target.value)} />
),
},
},
}}
/>
)
}
}
License
MIT © csalajan