1.0.1 • Published 6 years ago

@mhmdtshref/form v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
6 years ago

@mhmdtshref/form

React component that help you to create form without using state to get the values

NPM JavaScript Style Guide

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

1.0.1

6 years ago

1.0.0

6 years ago