1.0.1 • Published 6 years ago
@mhmdtshref/form v1.0.1
@mhmdtshref/form
React component that help you to create form without using state to get the values
Install
npm install --save @mhmdtshref/form
Usage
import React, { Component } from 'react'
import Form from '@mhmdtshref/form'
class Example extends Component {
render () {
const fields = [
{ type: 'text', name: 'username', placeholder: 'Type Username..' },
{ type: 'password', name: 'password', placeholder: 'Type Password..' }
];
const action = (values) => {
console.log('Field values on submit: ', values);
}
return (
<Form fields={fields} buttonValue="Submit" onSubmitAction{action} />
)
}
}
License
MIT © mhmdtshref