preact-to-json
Convert Preact components to JSON.
Note: This library currently only supports shallow rendering. If you need full (non-shallow) rendering, check out nathancahill/preact-render-to-json.
Installation
$ yarn add --dev preact-to-json
Usage
// ES6 // ES5const render = // With Jest // test.snapexports`Component renders 1` = `<a href="//google.com"> Google</a>`;
Change Log
v1.1.2 (2018-01-26)
- [
7201875d00
] - Handle when null/undefined children are rendered (Neil Kistner)
License
MIT © Neil Kistner