Skip to content

Commit

Permalink
fix: update ComponentRef comment (DefinitelyTyped#71660)
Browse files Browse the repository at this point in the history
  • Loading branch information
suzukisan22 authored Jan 23, 2025
1 parent 862f389 commit 0ac324e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions types/react/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1508,13 +1508,13 @@ declare namespace React {
* @example
*
* ```tsx
* type MyComponentRef = React.ElementRef<typeof MyComponent>;
* type MyComponentRef = React.ComponentRef<typeof MyComponent>;
* ```
*
* @example
*
* ```tsx
* type DivRef = React.ElementRef<'div'>;
* type DivRef = React.ComponentRef<'div'>;
* ```
*/
type ComponentRef<T extends ElementType> = ComponentPropsWithRef<T> extends RefAttributes<infer Method> ? Method
Expand Down
4 changes: 2 additions & 2 deletions types/react/ts5.0/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1507,13 +1507,13 @@ declare namespace React {
* @example
*
* ```tsx
* type MyComponentRef = React.ElementRef<typeof MyComponent>;
* type MyComponentRef = React.ComponentRef<typeof MyComponent>;
* ```
*
* @example
*
* ```tsx
* type DivRef = React.ElementRef<'div'>;
* type DivRef = React.ComponentRef<'div'>;
* ```
*/
type ComponentRef<T extends ElementType> = ComponentPropsWithRef<T> extends RefAttributes<infer Method> ? Method
Expand Down

0 comments on commit 0ac324e

Please sign in to comment.