# formik-form-callbacks

> callbacks fro formik forms

Latest version **1.0.1** (published 2019-05-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install formik-form-callbacks
pnpm add formik-form-callbacks
yarn add formik-form-callbacks
bun add formik-form-callbacks
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2019-05-13 |
| First published | 2019-05-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=8 |
| Dependencies | 0 |
| Unpacked size | 11.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 13 |
| Author | guiyep |
| Maintainers | guiyep |

## Links

- npm: https://www.npmjs.com/package/formik-form-callbacks
- Repository: https://github.com/guiyep/formik-form-callbacks
- Homepage: https://github.com/guiyep/formik-form-callbacks#readme
- Issues: https://github.com/guiyep/formik-form-callbacks/issues
- npm.io page: https://npm.io/package/formik-form-callbacks

## Recent versions

- 1.0.1 (latest) — 2019-05-13
- 1.0.0 — 2019-05-13

## README

# formik-form-callbacks

> formik form callbacks

The formik owner is not providing with any `on-change` or `on-validation-change` or `on-field-change` callbacks over the formik form, and his side library `formik-effect` is not maintain anymore and it doesn't even work. He relays on having all the logic in the formik fields.

I created this 3 components to use them inside a formik form so we can listen to changes, they are super simple and they use `react-hooks` under the hood.

cheers!

[![NPM](https://img.shields.io/npm/v/formik-form-callbacks.svg)](https://www.npmjs.com/package/formik-form-callbacks) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

## Install

```bash
npm install --save formik-form-callbacks
```

## Usage

```jsx
import React, { Component } from 'react';

import { WithOnChangeHandler, WithOnValidationChangeHandler, WithOnFieldChangeHandler } from 'formik-form-callbacks';

class Example extends Component {
  render() {
    return (
      <Formik
        initialValues={{ email: '' }}
        validationSchema={Yup.object().shape({
          email: Yup.string().required(),
        })}
      >
        {() => {
          return (
            <form>
              <WithOnChangeHandler>
                {({ values, errors }) => console.log('any value changed', errors, values)}
              </WithOnChangeHandler>
              <WithOnFieldChangeHandler field="email2">
                {({ values, errors }) => console.log('email2 field changed', errors, values)}
              </WithOnFieldChangeHandler>
              <WithOnValidationChangeHandler>
                {({ values, errors }) => console.log(`validation changed`, errors, values)}
              </WithOnValidationChangeHandler>
              <Field type="email" name="email" placeholder="Email" />
              <Field type="email" name="email2" placeholder="Email" />
              <Field type="email" name="email3" placeholder="Email" />
            </form>
          );
        }}
      </Formik>
    );
  }
}
```

## License

MIT © [guiyep](https://github.com/guiyep)

---
_Source: https://npm.io/package/formik-form-callbacks · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
