Render JSX and Preact components to JSON. Useful for Jest Snapshot testing.
import preact from 'preact'
import render from 'preact-render-to-json'
/** @jsx preact.h */
let component = <div class="foo">content</div>;
test('component', () => {
const tree = render(component)
expect(tree).toMatchSnapshot()
})