# react-attr-converter

> Convert HTML attribute names to React props

Latest version **0.3.1** (published 2017-07-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-attr-converter
pnpm add react-attr-converter
yarn add react-attr-converter
bun add react-attr-converter
```

## 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.3.1 |
| Published | 2017-07-12 |
| First published | 2015-12-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Hyunje Jun |
| Maintainers | noraesae |
| Keywords | react, attribute, props |

## Links

- npm: https://www.npmjs.com/package/react-attr-converter
- Repository: https://github.com/noraesae/react-attr-converter
- Homepage: https://github.com/noraesae/react-attr-converter#readme
- Issues: https://github.com/noraesae/react-attr-converter/issues
- npm.io page: https://npm.io/package/react-attr-converter

## 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.3.1 (latest) — 2017-07-12
- 0.3.0 — 2017-07-12
- 0.2.0 — 2017-06-20
- 0.1.1 — 2016-07-24
- 0.1.0 — 2015-12-19
- 0.0.2 — 2015-12-19
- 0.0.1 — 2015-12-19

## README

# react-attr-converter [![travis-ci](https://travis-ci.org/noraesae/react-attr-converter.svg)](https://travis-ci.org/noraesae/react-attr-converter)

Convert HTML attribute names to React props.

## Convert how?

It converts HTML attribute names into prop names used by React.

```js
convert('class'); // => 'className'
convert('for'); // => 'htmlFor'
convert('onclick'); // => 'onClick'
convert('onCLICK'); // => 'onClick'
```

It bypasses attribute names which are not supported by React.

```js
convert('data-hello'); // => 'data-hello'
convert('lovelive'); // => 'lovelive'
```

## How to use

Install with NPM:

```
npm i --save react-attr-converter
```

Import with CommonJS or whatever:

```js
const convert = require('react-attr-converter');

import convert from 'react-attr-converter';
import * as convert from 'react-attr-converter'; // both of them work
```

## A bug!

When a bug is found, please report them in [Issues](https://github.com/noraesae/react-attr-converter/issues).

Also, any form of contribution(especially a PR) will absolutely be welcomed :beers:

## License

[MIT](LICENSE)

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