Skip to content

Commit

Permalink
type: replace React.RefAttributes => RefAttributes (#530)
Browse files Browse the repository at this point in the history
  • Loading branch information
li-jia-nan authored May 4, 2024
1 parent e9900fa commit 078b6a0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/ref.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,13 @@ export const supportRef = (nodeOrComponent: any): boolean => {
return true;
};

interface RefAttributes<T> extends React.Attributes {
ref: React.Ref<T>;
}

export const supportNodeRef = <T = any>(
node: React.ReactNode,
): node is React.ReactElement & React.RefAttributes<T> => {
): node is React.ReactElement & RefAttributes<T> => {
if (!isValidElement(node)) {
return false;
}
Expand Down

0 comments on commit 078b6a0

Please sign in to comment.