Convert HTML attribute names to React props
npm install react-attr-converterConvert HTML attribute names to React props.
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'
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
``
When a bug is found, please report them in Issues.
Also, any form of contribution(especially a PR) will absolutely be welcomed :beers: