/2018-package-preact-render-dom

[ARCHIVED] Renders a Preact component in the DOM.

Primary LanguageTypeScriptMIT LicenseMIT

Render to DOM

Greenkeeper badge

Renders a Preact component in the DOM, similar to @wildpeaks/react-render-dom.

Install:

npm install @wildpeaks/preact-render-dom

Example:

import {h} from 'preact';
import {render} from '@wildpeaks/preact-render-dom';

interface MyProps {
	href: string;
}

const container = document.createElement('div');
const MyComponent: preact.FunctionalComponent<MyProps> = (props: MyProps) => h('a', props);
render<MyProps>(container, MyComponent, {href: 'stateless'});