Socket
Socket
Sign inDemoInstall

final-form-set-field-data

Package Overview
Dependencies
3
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    final-form-set-field-data

Mutator for setting arbitrary metadata on fields in 🏁 Final Form


Version published
Weekly downloads
16K
decreased by-23.93%
Maintainers
1
Install size
10.1 kB
Created
Weekly downloads
 

Readme

Source

🏁 Final Form Set Field Data

NPM Version NPM Downloads Build Status codecov.io styled with prettier

Mutator for setting arbitrary metadata for fields in 🏁 Final Form.


Installation

npm install --save final-form-set-field-data

or

yarn add final-form-set-field-data

Usage

import { createForm } from 'final-form'
import setFieldData from 'final-form-set-field-data'

// Create Form
const form = createForm({
  mutators: { setFieldData },
  onSubmit
})

form.mutators.setFieldData('firstName', { awesome: true })

form.registerField(
  'firstName',
  fieldState => {
    const { awesome } = fieldState.data // true
  },
  {
    // ...other subscription items
    data: true
  }
)

Mutator

form.mutators.setFieldData(name: string, values: Object) => void

Merges the values provided into the data value for the specified field

FAQs

Last updated on 07 Feb 2019

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc