v8.0.0-rc.0 #1890
markerikson
started this conversation in
General
v8.0.0-rc.0
#1890
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This release candidate removes the
DefaultRootState
type left over from the@types/react-redux
package. Additionally, we now have tests that exercise theserverState
SSR behavior added in a previous beta.At this point, React-Redux v8 is feature-complete and stable. We still really want users to try this out and give us feedback before the final release! Barring any reported issues, we plan to release 8.0 as final within the next few days.
Changelog
Removal of the
DefaultRootState
typeThe
@types/react-redux
package, which has always been maintained by the community, included aDefaultRootState
interface that was intended for use with TS's "module augmentation" capability. Bothconnect
anduseSelector
used this as a fallback if no state generic was provided. When we migrated React-Redux to TS, we copied over all of the types from that package as a starting point.However, the Redux team specifically considers use of a globally augmented state type to be an anti-pattern. Instead, we direct users to extract the
RootState
andAppDispatch
types from the store setup, and create pre-typed versions of the React-Redux hooks for use in the app.Now that React-Redux itself is written in TS, we've opted to remove the
DefaultRootState
type entirely. State generics now default tounknown
instead.Technically the module augmentation approach can still be done in userland, but we discourage this practice.
SSR Tests
We added a
serverState
prop to<Provider>
in beta.2 to resolve hydration mismatch issues, but had only done some quick hands-on testing locally. We now have tests that cover that use case.What's Changed
DefaultRootState
type by @markerikson in RemoveDefaultRootState
type #1887serverState
behavior by @markerikson in Add SSR test forserverState
behavior #1888Full Changelog: v8.0.0-beta.4...v8.0.0-rc.0
This discussion was created from the release v8.0.0-rc.0.
Beta Was this translation helpful? Give feedback.
All reactions