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
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
-
This release candidate removes the
DefaultRootStatetype left over from the@types/react-reduxpackage. Additionally, we now have tests that exercise theserverStateSSR 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
DefaultRootStatetypeThe
@types/react-reduxpackage, which has always been maintained by the community, included aDefaultRootStateinterface that was intended for use with TS's "module augmentation" capability. BothconnectanduseSelectorused 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
RootStateandAppDispatchtypes 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
DefaultRootStatetype entirely. State generics now default tounknowninstead.Technically the module augmentation approach can still be done in userland, but we discourage this practice.
SSR Tests
We added a
serverStateprop 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
DefaultRootStatetype by @markerikson in RemoveDefaultRootStatetype #1887serverStatebehavior by @markerikson in Add SSR test forserverStatebehavior #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