
Product
Announcing Socket Fix 2.0
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
react-dom-wrapper
Advanced tools
Convert an array of element data to react elements. Prettier than JSX, less verbose than using React.DOM directly. Inspired by (though not as pretty as) Hiccup.
$ npm install [--save] react-dom-wrapper
var DOM = require('react-dom-wrapper');
var element = DOM([
'div#wrapper',
{ className: 'asd' },
['span.message.important', 'hello', ['span.bold', name]],
[CustomComponent, { customProp: 'hello' }],
[
'ul',
arrayOfThings.map(function(thing) {
return ['li', { key: thing.id }, thing.value]
})
]
]);
React.render(element, mountNode);
If you want to use a different version of React entirely, you can do var DOM = require('react-dom-wrapper/react-dom-wrapper')(myCustomReact)
.
An element is an array consisting of:
There are test! Buster is used. npm test
runs the test, npm run autotest
watches the files and runs tests automatically.
MIT
FAQs
A (somewhat) helpful wrapper function for creating React elements
We found that react-dom-wrapper demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.