Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
vdom agnostic components
import preact from 'preact';
import createFoo from './foo';
import createBar from './bar';
export const Foo = createFoo(preact);
export const Bar = createBar(preact);
export default ({ h, createElement=h, Component }) => {
return class Foo extends Component {
render(){ return <div>{this.props.foo}</div> }
}
}
import { h, render } from 'preact';
import { Foo, Bar } from './components';
render(
<div>
<Foo />
<Bar />
</div>
, document.body);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment