Skip to content

Commit

Permalink
Copy changes from reduxjs#2168
Browse files Browse the repository at this point in the history
  • Loading branch information
aryaemami59 committed May 3, 2024
1 parent 4d30e85 commit 3fe18e7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/typetests/connect-options-and-issues.test-d.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -801,13 +801,13 @@ describe('type tests', () => {
ref={(ref: number) => {}}
/>

// Should be able to use all refs including legacy string
const classLegacyRef: React.LegacyRef<ClassComponent> | undefined =
undefined
// Should be able to use all refs (except legacy string refs, which go away in React 19)
const classLegacyRef: React.Ref<ClassComponent> | undefined = undefined
;<ConnectedClassComponent ref={classLegacyRef} />
;<ConnectedClassComponent ref={React.createRef<ClassComponent>()} />
;<ConnectedClassComponent ref={(ref: ClassComponent) => {}} />
;<ConnectedClassComponent ref={''} />
// TODO Can make this an expected error if we target React 19 exclusively
// ;<ConnectedClassComponent ref={''} />
;<ConnectedClassComponent
// @ts-expect-error ref type should be the typeof the wrapped component
ref={React.createRef<string>()}
Expand Down

0 comments on commit 3fe18e7

Please sign in to comment.