Skip to content
Preact integration for Redux (no shim needed!)
Branch: master
Clone or download
developit Merge pull request #30 from Johnbug/master
[FIX]fix typescript definition
Latest commit 344792e Dec 6, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src add semi Dec 6, 2018
test
.babelrc cleanup Apr 6, 2017
.eslintignore
.eslintrc
.gitignore Initial commit! 🚀 Jun 2, 2016
.npmignore Initial commit! 🚀 Jun 2, 2016
.travis.yml
LICENSE
README.md
karma.conf.js
package.json
rollup.config.js Update rollup.config.js Jun 30, 2017

README.md

preact-redux

NPM travis-ci

Wraps react-redux up for Preact, without using preact-compat.

Think of this as a version of react-redux that is pre-aliased to use preact in place of React.

See preact-redux-example: a full working example of redux + preact using preact-redux!


Usage Example

This is a contrived example. Please refer to Redux's Usage with React documentation for details on how to work with Redux from Preact.

import { Provider, connect } from 'preact-redux';
import { h, render } from 'preact';

const Main = () => (
	<Provider store={store}>
		<Child />
	</Provider>
);

const Child = connect(
	state => state
)( ({ text, setText }) => (
	<input value={text} onInput={e => setText(e.target.value)} />
) );

render(<Main />, document.body);

License

MIT

You can’t perform that action at this time.