Dom create for next.
npm install -S @jswork/next-dom-create
api | params | description |
---|---|---|
element | type,props, children | Create element node. |
text | value | Create text node. |
fragment | children | Create fragment node. |
import NxDomCreate from '@jswork/next-dom-create';
NxDomCreate.element(
'div',
{ id: '1', style: 'color: red; font-size: 12px;' },
'hello world.'
);
// <div id="1" style="color: red; font-size: 12px;">hello world.</div>
Code released under the MIT license.