# react-valid-attributes

> Exports two functions:

Latest version **0.0.2** (published 2018-12-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-valid-attributes
pnpm add react-valid-attributes
yarn add react-valid-attributes
bun add react-valid-attributes
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2018-12-29 |
| First published | 2018-03-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 2.3 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | menubar |

## Links

- npm: https://www.npmjs.com/package/react-valid-attributes
- Repository: https://github.com/unshift/react-valid-attributes
- Homepage: https://github.com/unshift/react-valid-attributes#readme
- Issues: https://github.com/unshift/react-valid-attributes/issues
- npm.io page: https://npm.io/package/react-valid-attributes

## Dependencies (3)

- [lodash.omit](https://npm.io/package/lodash.omit.md) ^4.5.0
- [lodash.pick](https://npm.io/package/lodash.pick.md) ^4.4.0
- [react-html-attributes](https://npm.io/package/react-html-attributes.md) ^1.4.1

## Recent versions

- 0.0.2 (latest) — 2018-12-29
- 0.0.1 — 2018-03-30

## README

## react-valid-attributes

Exports two functions:

- pick: pick all valid html attributes from props for a given element
- omit: omit all valid html attributes from props for a given element

Uses [react-html-attributes](https://www.npmjs.com/package/react-html-attributes).

## Example
```js
const { pick, omit }  = require('react-valid-attributes')

const props = {
  src: 'https://pbs.twimg.com/profile_images/765333670366355456/q5ACQ8i3_400x400.jpg',
  alt: 'The npm logo',
  handleImageClick: () => {}
}

const attributes = pick(props, 'img')
// => { src: '...', alt: '...' }

const rest = omit(props, 'img')
// => { handleImageClick }

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