yarn @reduxjs/toolkit 1.2.4

latest releases: 2.2.3, 2.2.2, 2.2.1...
4 years ago

This release tweaks the RTK-specific ThunkMiddleware type definition for better compatibility.

Changes

Thunk Middleware Type Definition

In v1.2.2, we improved our type definitions to correctly handle whether or not the thunk middleware was being used.

However, the tutorials and documentation recommended using a type like type AppThunk = ThunkAction<void, RootState, null, Action<string>>. The null for the extraArgument option no longer fit in with the changed types correctly and caused errors with code that was dispatching thunks in some cases.

We've tweaked the type definitions to better handle this, and updated the documentation to recommend using a type of type AppThunk = ThunkAction<void, RootState, unknown, Action<string>> instead.

Changelog

  • Better generic argument for default Thunk Middleware (@phryneas - #329)

v1.2.3...v1.2.4

Don't miss a new toolkit release

NewReleases is sending notifications on new releases.