Skip to content

Commit 3fe18e7

Browse files
committed
Copy changes from reduxjs#2168
1 parent 4d30e85 commit 3fe18e7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/typetests/connect-options-and-issues.test-d.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -801,13 +801,13 @@ describe('type tests', () => {
801801
ref={(ref: number) => {}}
802802
/>
803803

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

0 commit comments

Comments
 (0)