-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bring back getReactNodeRef and deprecate it
- Loading branch information
1 parent
16c974c
commit 04bcd80
Showing
3 changed files
with
18 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import * as React from 'react'; | ||
import getReactElementRef from '../getReactElementRef'; | ||
|
||
/** | ||
* Returns the ref of a React element handling differences between React 19 and older versions. | ||
* It will throw runtime error if the element is not a valid React element. | ||
* | ||
* @param element React.ReactElement | ||
* @returns React.Ref<any> | null | ||
* | ||
* @deprecated Use getReactElementRef instead | ||
*/ | ||
|
||
export default function getReactNodeRef(element: React.ReactElement): React.Ref<any> | null { | ||
return getReactElementRef(element); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default } from './getReactNodeRef'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters