reduxjs / redux

A JS library for predictable global state management
https://redux.js.org
MIT License
60.51k stars 15.26k forks source link

The wrong export in redux/examples/counter-ts/src/features/counter/counterSlice.ts #4671

Closed koujiangheng closed 3 months ago

koujiangheng commented 3 months ago

Prior Issues

The wrong export make counter-ts example error compile, in file https://github.com/reduxjs/redux/blob/master/examples/counter-ts/src/features/counter/counterSlice.ts line 84 Should change export default counterSlice.reducer; to export default counterReducer = counterSlice.reducer;

What is the current behavior?

TypeError _reactRedux.useDispatch.withTypes is not a function

Steps to Reproduce

open official example

What is the expected behavior?

There should be no error showing.

Environment Details

version 8.0.2

EskiMojo14 commented 3 months ago

the export you've suggested is invalid syntax, and it's unrelated to the issue at hand

what's actually happening is that the example is using a feature from React Redux 9.1.0 while depending on 8.0.2, which indeed needs fixing