Skip to content
A utility method to create preact components without using class keyword
Branch: master
Clone or download
laurencedorman Merge pull request #9 from laurencedorman/dependabot/npm_and_yarn/lod…

build(deps): bump lodash from 4.17.11 to 4.17.14
Latest commit 2b44ac7 Jul 15, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
.editorconfig add: basic functionality Apr 27, 2016
.gitignore update distribution files May 3, 2016
.npmignore remove: npm-debug Apr 27, 2016
.travis.yml npm audit: remove jscs, mocha, chai Apr 29, 2019
LICENSE Initial commit Apr 27, 2016 update: readme badges Feb 23, 2018
index.js npm audit: remove jscs, mocha, chai Apr 29, 2019
package.json 2.0.0 Apr 29, 2019
test.js npm audit: remove jscs, mocha, chai Apr 29, 2019

Preact Classless Component

npm travis Dependency Status devDependency Status

If you use the Preact library, but don't want to use the class syntax because you've read articles by Eric Elliott and others that have lead you to favour object composition over class inheritance, then this utility is for you.


$ npm install --save preact-classless-component


/* ES6 Modules */

import createComponent from 'preact-classless-component';

/* CommonJS */

const createComponent = require('preact-classless-component');

const Component = createComponent({
	render(props, state) {
		return (
				Hello world!


Thanks to Jason Miller for his help on debugging this function.



You can’t perform that action at this time.