preact-redux

WebJar for preact-redux

License

License

MIT
Categories

Categories

React User Interface Web Frameworks
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

preact-redux
Last Version

Last Version

2.0.3
Release Date

Release Date

Type

Type

jar
Description

Description

preact-redux
WebJar for preact-redux
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/developit/preact-redux

Download preact-redux

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/preact-redux/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>preact-redux</artifactId>
    <version>2.0.3</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/preact-redux/
implementation 'org.webjars.npm:preact-redux:2.0.3'
// https://jarcasting.com/artifacts/org.webjars.npm/preact-redux/
implementation ("org.webjars.npm:preact-redux:2.0.3")
'org.webjars.npm:preact-redux:jar:2.0.3'
<dependency org="org.webjars.npm" name="preact-redux" rev="2.0.3">
  <artifact name="preact-redux" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='preact-redux', version='2.0.3')
)
libraryDependencies += "org.webjars.npm" % "preact-redux" % "2.0.3"
[org.webjars.npm/preact-redux "2.0.3"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

preact-redux

NPM travis-ci

Wraps react-redux up for Preact (8.x and prior), 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!

๐Ÿ’โ€ Compatibility Note:

If you're using Preact X (preact@10+), please use the official react-redux library.


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

Versions

Version
2.0.3