richardcrng / redux-leaves

Write once. Reduce anywhere.
https://redux-leaves.js.org
50 stars 4 forks source link

useReducer example not working with latest version #181

Open CarlMungazi opened 4 years ago

CarlMungazi commented 4 years ago

This example does not seem to be working with the following package versions:

    "react": "16.13.1",
    "react-dom": "16.13.1",
    "react-scripts": "3.2.0",
    "redux-leaves": "^2.0.0"

I was trying to follow this example and I was getting the following error:

Screenshot 2020-09-16 at 00 50 10

I thought I was doing something wrong but when I updated the example to match my versions, the same error appeared. I don't understand this lib enough to know what the issue could be, so any insight would be useful!

arezki1990 commented 4 years ago

same thing for me , did you resolve the issue ?

CarlMungazi commented 4 years ago

I bumped my version down to 0.7.4 and used that instead. It's a short-term fix until @richardcrng is able to shed more light.

richardcrng commented 4 years ago

Thanks for using and flagging, @CarlMungazi and @arezki1990!

I'm in the process of deprecating Redux-Leaves in favour of Riduce (also created by me) - it's essentially the same library (shared API and a common git history), but with significant refactoring for stronger TypeScript support and a new name to de-emphasise Redux (since it should be usable with useReducer).

I haven't investigated why this useReducer example didn't work with the latest version of Redux-Leaves, but it works for me with Riduce (sandbox here).

So, as a fix for now, can you swap out redux-leaves for riduce?

(At some point, I might patch Redux-Leaves, but I don't intend to support it long-term)