jsx-dom-runtime
![minzip](https://badgen.net/bundlephobia/minzip/jsx-dom-runtime)
Install
npm i jsx-dom-runtime
yarn add jsx-dom-runtime
How to use
.babelrc
{
"presets": [
"jsx-dom-runtime/babel-preset"
]
}
Example
import { createRef } from 'jsx-dom-runtime';
const App = () => {
const List = createRef();
const addItem = () => {
<List.current>
<li>New Item</li>
</List.current>
};
return (
<>
<button type="button" onClick={addItem}>
Add Item
</button>
<ul ref={List} />
</>
);
};
<document.head>
<link rel="stylesheet" href="/style.css" />
</document.head>;
<document.body id="root">
<App />
</document.body>;
Demo
License
MIT