Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

simple-forms-react

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simple-forms-react

An awesome Form for React!

  • 1.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-90.91%
Maintainers
1
Weekly downloads
 
Created
Source

simple-forms-react

yet another Form component

install

npm i -S simple-forms-react

usage

Form props

nametypedefaultdescription
initialValuesObject{}you should pass all the fields as keys and their default/initial values
childrenfunction({values, touched, errors, valid, isSubmitting, fieldProps, handleSubmit, setValues, setSubmitting}) => {}this function should return the JSX which contains the form and all inputs
validatorsObject{}this contains validators for each input, please see Validator section to see the contract of a validator function

children function arguments

nametypedescription
valuesObjectcontains values of all the inputs
touchedObjectkey-value of inputs and whether they've been touched or not
errorsObjecterrors object contains error message for inputs if there's an error
validbooleantells if the entire form is valid or not
isSubmittingbooleantells if the form is submitting, useful to make your submit button disabled or hide altogether
fieldPropsfunctionthis returns the props that need to be applied on the input, you should pass all the props in as an object, it chains onChange and other things which Form uses internally
handleSubmitfunctionuse this as onSubmit prop of <form>
setValuesfunctionaccepts an object and updates the values of the inputs as per the passed argument
setSubmittingfunctiona helper utility to change the isSubmitting flag.

Keywords

FAQs

Package last updated on 05 Feb 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc