2.0.0 • Published 5 years ago

preact-classless-component v2.0.0

Weekly downloads
65
License
MIT
Repository
github
Last release
5 years ago

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.

Installation

$ npm install --save preact-classless-component

Usage

/* ES6 Modules */

import createComponent from 'preact-classless-component';

/* CommonJS */

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

const Component = createComponent({
	render(props, state) {
		return (
			<div>
				Hello world!
			</div>
		);
	}
});

Acknowledgments

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

License

MIT

2.0.0

5 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago