Closed
Description
The docs show inferring type RootState = ReturnType<typeof rootReducer>
. But, if you pass the slice reducers directly to configureStore()
, you never created the root reducer yourself, so you need to infer it as type RootState = ReturnType<typeof store.getState>
instead.
We should update the Advanced Tutorial and Usage with TypeScript pages to mention that.
See https://stackoverflow.com/a/59827580/62937 for an example of this