# react-native-chainable

> Chain through your React Native forms with ease

Latest version **1.0.20** (published 2020-04-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-native-chainable
pnpm add react-native-chainable
yarn add react-native-chainable
bun add react-native-chainable
```

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.20 |
| Published | 2020-04-02 |
| First published | 2018-10-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 7.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 24 |
| Maintainers | samchamberland |

## Links

- npm: https://www.npmjs.com/package/react-native-chainable
- Repository: https://github.com/samchamberland/react-native-chainable
- Homepage: https://github.com/samchamberland/react-native-chainable#readme
- Issues: https://github.com/samchamberland/react-native-chainable/issues
- npm.io page: https://npm.io/package/react-native-chainable

## Recent versions

- 1.0.20 (latest) — 2020-04-02
- 1.0.19 — 2020-04-02
- 1.0.18 — 2020-03-20
- 1.0.17 — 2020-03-19
- 1.0.16 — 2020-03-14
- 1.0.15 — 2020-03-14
- 1.0.14 — 2020-02-22
- 1.0.13 — 2020-02-11
- 1.0.12 — 2019-12-04
- 1.0.11 — 2019-10-17
- 1.0.10 — 2019-10-16
- 1.0.9 — 2019-07-31
- 1.0.8 — 2019-06-22
- 1.0.7 — 2019-04-09
- 1.0.6 — 2019-03-11
- … 10 more at https://npm.io/package/react-native-chainable/versions

## README

# react-native-chainable

Chain through your React Native forms with ease

## Installation

```sh
npm i react-native-chainable
```

## Usage

```jsx
class SignUpScreen extends Component {
  // ...

  render() {
    return (
      <Chainable>
        {(chain) => (
          <>
            <Chainable.Input
              value={this.state.email}
              onChangeText={(text) => this.setState({ email: text })}
              onSubmitEditing={() => chain('password')}
            />
            <Chainable.Input
              value={this.state.password}
              onChangeText={(text) => this.setState({ password: text })}
              secureTextEntry
              onSubmitEditing={() => chain('confirm')}
              name="password"
            />
            <Chainable.Input
              value={this.state.confirm}
              onChangeText={(text) => this.setState({ confirm: text })}
              secureTextEntry
              name="confirm"
              isLast
            />
          </>
        )}
      </Chainable>
    );
  }
}
```

## API

`Chainable`

### Render prop (function as children)

The function you pass as a child will be called with a function that allows you to chain to (i.e. set focus on) the next input by name

| Type                   | Description                                 |
| ---------------------- | ------------------------------------------- |
| (name: string) => void | Function to chain to the next input by name |

`Chainable.Input`

### Props

| Name   | Type                                    | Description                                                 |
| ------ | --------------------------------------- | ----------------------------------------------------------- |
| name   | string (optional)                       | A name for the input                                        |
| isLast | boolean (optional, defaults to `false`) | When `true`, the input should be considered as the last one |

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