Redux-bundler-preact provides essential bindings to integrate redux-bundler with Preact applications. It offers a `Provider` component to make the redux-bundler store available via context and a `connect` higher-order component for mapping selectors and action creators to component props. The current stable version is 2.0.1, which targets Preact versions 10.0.0 and above. Earlier Preact versions (v3-8) require installing redux-bundler-preact v1. Releases are typically tied to major Preact version updates or critical bug fixes, as seen with the 2.0.0 upgrade for Preact X. A key differentiator is its `connect` API, which accepts string names for selectors and action creators, departing from the typical function-based mapStateToProps/mapDispatchToProps patterns found in other Redux bindings, offering improved performance characteristics where diffing happens outside the component itself.
npm install redux-bundler-preactVerified import paths — ran on the pinned version, not inferred.
This example demonstrates how to set up the `Provider` at the application root with a Redux-Bundler store and how to `connect` a component to specific selectors and action creators using their string names.
If using Preact >=10.0.0, install `redux-bundler-preact`. For Preact v3-8, you must install `redux-bundler-preact@^1`.
Always meticulously verify the string names passed to `connect()` against your Redux-Bundler's defined selectors and action creators. Typographical errors are a common source of these runtime issues.
Carefully check the spelling and ensure the existence of all selector and action creator names passed as strings to `connect()`. Confirm that your Redux-Bundler bundles correctly export these members.
Ensure that the function or variable supplying your Redux-Bundler store to the `Provider` (e.g., `getStore()` in examples) correctly returns an initialized and valid store instance.