# @faumally/react

> React form library based on state machines

Latest version **0.1.4-alpha.0** (published 2021-03-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install @faumally/react
pnpm add @faumally/react
yarn add @faumally/react
bun add @faumally/react
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.4-alpha.0 |
| Published | 2021-03-12 |
| First published | 2021-03-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 37.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Joshua Amaju |
| Maintainers | joshuaamaju |
| Keywords | react, form, data, collection, analytics, input |

## Links

- npm: https://www.npmjs.com/package/@faumally/react
- Repository: https://github.com/JoshuaAmaju/faumally
- Homepage: https://github.com/JoshuaAmaju/faumally/tree/master/packages/faumally-react#readme
- Issues: https://github.com/JoshuaAmaju/faumally/issues
- npm.io page: https://npm.io/package/@faumally/react

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.1.4-alpha.0 (latest) — 2021-03-12
- 0.1.3-alpha.0 — 2021-03-11
- 0.1.2-alpha.0 — 2021-03-11
- 0.1.1-alpha.0 — 2021-03-11
- 0.1.0-alpha.0 — 2021-03-10

## README

# `@faumally/react`

> React hooks for form handling backed by state machines

## Usage

```typescript
import useFaumally from "@faumally/react";

type Form = {
  age: number;
  email: string;
  address: string;
  lastName: string;
  firstName: string;
};

const config = { required: true };

const createUser = (user: any) => Promise.resolve();

const { submit, handlers, subscribe } = useFaumally<Form>({
  schema: {
    email: config,
    lastName: config,
    firstName: config,
    address: "string",
    age: {
      ...config,
      initialValue: 0,
    },
  },
  onSubmit(data) {
    return createUser(data);
  },
});
```

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