developit / developit/preact-redux

preact-redux 2.1.0 not working with preact-router when passing route values

Open
#47 2 comments 0 reactions 0 assignees View on GitHub
bug help wanted legacy
Dominant language
JavaScript
Stars
285
Forks
26
PR merge metrics
No merged PRs in 30d

Description

First I would like to note: PREACT is fantastic, that is why we have put forth great effort to continue using it.

Our app is now lightning fast due to the great work at PREACT, PREACT-REDUX and the PREACT-CLI – keep it up!!.

We had a very similar issue to [this](https://github.com/preactjs/preact-router/issues/320) so we decided to post an example hoping that the owners of PREACT-REDUX will see it clearly, and have a fast path to remedy.

First I created the “brandnew” app ([brandnew.zip](https://github.com/developit/preact-redux/files/3290972/brandnew.zip)) (using preact-cli version 2.2.1)

- preact create default brandnew

I then created a simple example that would work, DemoIssue and AnotherComponent are the two components that should display what is given in the route parameters when the links Demo 1 or Demo 2 are clicked.

Alas it works :)

Then I added redux to the mix

- npm install redux --save
- npm install preact-redux –save
- npm install preact-context –save (This can be removed later..read on)

This installs preact-redux: “^2.1.0

I then added a simple example of wiring up to redux (Nothing fancy, just a counter to prove it works).

Alas it is broken, hmmmm?

At this point in the app, I could comment out the redux connect in demo-issue.js and simply use the “export default DemoIssue” and it would still work, however we really need redux…

After trial and error we figured out that if we revert to
preact-redux 2.0.3 – **NOT** **preact-redux ^2.0.3** – the app works as expected!!!.

Now that we have gone back to 2.0.3 you can safely remove preact-context as it is no longer a dependency.

Hope that helps in figuring out what is really wrong.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.