unimorph
v0.0.0
Published
Universal DOM morphing
Downloads
8
Maintainers
Readme
unimorph
Universal DOM morpher with nanomorph / morphdom compatible API.
Supported libs
- [ ] react
- [ ] preact
- [ ] lit-html
import { html } from 'lit-html'
import morph from 'unimorph/lit-html'
var el = document.createElement('div')
el.innerHTML = 'hello people'
el = morph(el, html`<div>nanananana-na-no</div>`)
// <div>nanananana-na-no</div>
el = morph(el, html`<div>teeny, tiny, tin bottle</div>`)
// <div>teeny, tiny, tin bottle</div>
unimorph can morph both to JSX or raw HTML. It works with react by default, preact can be used via preact/compat
or directly as:
import morph from 'unimorph/preact'
let result = morph(fromElement, toElementOrJSX)