# react-stateless-input

> Alternative to refs inside your React stateless components inputs.

Latest version **1.0.3** (published 2016-05-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-stateless-input
pnpm add react-stateless-input
yarn add react-stateless-input
bun add react-stateless-input
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2016-05-19 |
| First published | 2016-05-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Didier Franc |
| Maintainers | didierfranc |
| Keywords | react, stateless, input, form |

## Links

- npm: https://www.npmjs.com/package/react-stateless-input
- Repository: https://github.com/didierfranc/react-stateless-input
- Homepage: https://github.com/didierfranc/react-stateless-input#readme
- Issues: https://github.com/didierfranc/react-stateless-input/issues
- npm.io page: https://npm.io/package/react-stateless-input

## 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

- 1.0.3 (latest) — 2016-05-19
- 1.0.2 — 2016-05-19
- 1.0.1 — 2016-05-19
- 1.0.0 — 2016-05-19

## README

# react-stateless-input
Alternative to refs for your inputs inside your **React stateless components**, of course you can use this snippet with or without React and with any library.

## What is it ?

It's just two lines of ES6+ :
```js
let o, i, l = document.querySelectorAll('input:not([type=submit])')
for (i of l) { o = { ...o, [i.name]: i.value } } return o
```

## Example

```js
npm install -S react-stateless-input
```
*Login.js*
```js
import React from 'react'
import inputs from 'react-stateless-input'

const Login = (props) => {

  const handleSubmit = (e) => {
    e.preventDefault()
    const { email, password } = inputs()
    login(email, password)
  }

  return(
    <form onSubmit={handleSubmit}>
      <input type="email" name="email" placeholder="Email"/>
      <input type="password" name="password" placeholder="Password"/>
      <input type="submit"/>
    </form>
  )

}

export default Login
```

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