Skip to content

Commit

Permalink
Update ref.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
afc163 authored Feb 8, 2025
1 parent 99d8344 commit b26f068
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ref.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type * as React from 'react';
import { isValidElement } from 'react';
import { isValidElement, version } from 'react';
import { ForwardRef, isMemo } from 'react-is';
import useMemo from './hooks/useMemo';
import isFragment from './React/isFragment';
Expand Down Expand Up @@ -45,7 +45,7 @@ export const supportRef = (nodeOrComponent: any): boolean => {
// React 19 no need `forwardRef` anymore. So just pass if is a React element.
if (
isReactElement(nodeOrComponent) &&
React.version.startsWith('19.')
version.startsWith('19.')
) {
return true;
}
Expand Down

0 comments on commit b26f068

Please sign in to comment.