react-native-web-hooks
react-native-web-hooks copied to clipboard
getNode is being phased out
Hi! 👋
Firstly, thanks for your work on this project! 🙂
Today I used patch-package to patch [email protected] for the project I'm working on.
This resolved a warning about getNode being deprecated in the future.
Screenshot:

Here is the diff that solved my problem:
diff --git a/node_modules/react-native-web-hooks/build/createPseudoHook.js b/node_modules/react-native-web-hooks/build/createPseudoHook.js
index 2c544fb..002cda5 100644
--- a/node_modules/react-native-web-hooks/build/createPseudoHook.js
+++ b/node_modules/react-native-web-hooks/build/createPseudoHook.js
@@ -11,7 +11,7 @@ export default function createPseudoHook({ events }) {
const [isActive, setActive] = React.useState(false);
React.useEffect(() => {
const [eventIn, eventOut] = events;
- const node = getNode(ref);
+ const node = ref.current;
if (!node) {
return;
}
This issue body was partially generated by patch-package.
This also resolves, "Couldn't find node Error: Argument appears to not be a ReactComponent. Keys: current" I was getting after import.
@EvanBacon Are there no more plans for updates? I would appreciate it if you could include changes like this for React 19.