diff --git a/package.json b/package.json index ae698698e..b1a6e3e38 100644 --- a/package.json +++ b/package.json @@ -83,6 +83,7 @@ "@testing-library/react": "^14.1.2", "@testing-library/react-hooks": "^8.0.1", "@types/node": "^20.11.6", + "@types/prop-types": "^15.7.12", "@types/react": "18.2.25", "@typescript-eslint/eslint-plugin": "^6.17.0", "@typescript-eslint/parser": "^6.17.0", diff --git a/test/components/Provider.spec.tsx b/test/components/Provider.spec.tsx index b6caf0f37..1c9dce755 100644 --- a/test/components/Provider.spec.tsx +++ b/test/components/Provider.spec.tsx @@ -169,7 +169,7 @@ describe('React', () => { action.type === 'INC' ? state + 1 : state const innerStore = createStore(reducer) - const innerMapStateToProps = vi.fn((state) => ({ + const innerMapStateToProps = vi.fn<[number], TStateProps>((state) => ({ count: state, })) class Inner extends Component { diff --git a/test/typetests/connect-options-and-issues.tsx b/test/typetests/connect-options-and-issues.tsx index be23afc4b..1579397c4 100644 --- a/test/typetests/connect-options-and-issues.tsx +++ b/test/typetests/connect-options-and-issues.tsx @@ -801,8 +801,8 @@ function testRef() { ref={(ref: number) => {}} > - // Should be able to use all refs including legacy string - const classLegacyRef: React.LegacyRef | undefined = undefined + // Should be able to use all refs (except legacy string refs, which go away in React 19) + const classLegacyRef: React.Ref | undefined = undefined ; ;()} @@ -810,7 +810,8 @@ function testRef() { ; {}} > - ; + // TODO Can make this an expected error if we target React 19 exclusively + // ; // ref type should be the typeof the wrapped component ;