react-domproperty
v1.0.6
Published
Convert HTML DOM attributes to React DOM attributes
Downloads
12
Maintainers
Readme
Why?
- react-attr-convert does a great job but it has no longer been maintained.
- babel-plugin-react-html-attrs is just overkill for such a simple conversion task.
Usage
const convert = require('react-domproperty');
// nomral html attribute
convert('autoplay'); // => autoPlay
convert('crossOrigin'); // => crossOrigin
// SVG attribute
convert('xml:base'); // => xmlBase
// event handler
convert('onclick'); // => onClick
// bypass custom attributes
convert('custom-x'); // => custom-x
Supported Attributes
See attributes.
Other
This project uses ts-rollup-boilerplate as a starter.