mrzachnugent / react-native-reusables

Universal shadcn/ui for React Native featuring a focused collection of components - Crafted with NativeWind v4 and accessibility in mind.
https://rnr-docs.vercel.app
MIT License
2.96k stars 127 forks source link

[ BUG ] Button not losing active state #194

Closed ImamJanjua closed 1 month ago

ImamJanjua commented 1 month ago

@mrzachnugent I had created similar issue in the past but Now I am very sure the issue is related to the component. Check out the clip. So as u can see here I started the app with cleaned cache. So button works fine, until I added just to call the func on press where i get many error and this press affect

https://github.com/user-attachments/assets/164497e4-9e5e-4c9f-9860-e3cfa930727b

ImamJanjua commented 1 month ago
Screenshot 2024-07-27 at 17 58 59 Screenshot 2024-07-27 at 17 59 13 Screenshot 2024-07-27 at 17 59 34 Screenshot 2024-07-27 at 17 59 46
ImamJanjua commented 1 month ago

@mrzachnugent any though on that

mrzachnugent commented 1 month ago

Hey @ImamJanjua, as mentioned in https://github.com/mrzachnugent/react-native-reusables/issues/186, I would need a minimal reproduction repo to look into this since I am not able to reproduce it on my side.

ImamJanjua commented 1 month ago

@mrzachnugent repo, so as u can see there, If I just call a simple api, this bug will take effect

mrzachnugent commented 1 month ago

@ImamJanjua After some investigation, if you replace your test function with:

  async function test() {
    const res = await fetch("https://icanhazdadjoke.com/", {
      method: "GET",
      headers: {
        "Content-Type": "application/json",
        Accept: "application/json",
      },
    });
    const jsonData = await res.json();
    console.log(jsonData);
  }

The warning goes away. So it seems the experimental api directory feature is causing this warning. I also noticed that if you keep using the api directory but you removed all of the button classNames that start with web: then it would also remove the warning.

I would suggest creating an issue for expo-router using the same repo as the minimal reproduction repo.