LovesWorking / react-native-react-query-devtools

React Query Dev Tools for React Native
75 stars 6 forks source link

TypeError: Cannot read property 'writeText' of undefined, js engine: hermes #4

Closed mgmaldo closed 3 months ago

mgmaldo commented 5 months ago

Description

Pressing the "copy to clipboard" button throws the following error: TypeError: Cannot read property 'writeText' of undefined, js engine: hermes

Setup


It appears that the navigator.clipboard functionality used in the handleCopy method is not supported in mobile

  const handleCopy = () => {
    navigator.clipboard
      .writeText(JSON.stringify(value))
      .then(() => {
        setCopyState("SuccessCopy");
        setTimeout(() => setCopyState("NoCopy"), 1500);
      })
      .catch((err) => {
        console.error("Failed to copy: ", err);
        setCopyState("ErrorCopy");
        setTimeout(() => setCopyState("NoCopy"), 1500);
      });
  };
anton-patrushev commented 4 months ago

Have just the same problem. Using:

Any plans to review and provide a fix for this? @LovesWorking

LovesWorking commented 4 months ago

Have just the same problem. Using:

  • "react-native": "0.72.12"
  • "@tanstack/react-query": "5.29.0"
  • "react-native-react-query-devtools": "1.1.0"

Any plans to review and provide a fix for this? @LovesWorking

Yes, I'll apply a fix for this. Thank you. :)

C-Cipher404 commented 3 months ago

A new version has been releasesd to fix this. v1.1.1

anton-patrushev commented 1 month ago

I want to double check on this @lilblondyy the fix was provided for v1.1.1 and it's fixed only for expo projects, correct?