react-native-reusables
react-native-reusables copied to clipboard
[ BUG ] ThemeToggle not changing on press
Describe the bug Using an unmodified (other than running through a tunnel and removing --ios from the Dev script) base starter, the ThemeToggle at the top right does absolutely nothing. If I had to guess it is only paying attention to the system default, in my case dark mode.
To Reproduce Steps to reproduce the behavior:
- Run the init from the CLI and create a new Starter Base
- Run with 'bun dev' and open in Expo Go
- Click on 'MoonStar Icon'
- Theme does not toggle
- Note: It does work on the web version
Expected behavior I expect the theme to switch between light and dark mode on press
Platform (please complete the following information):
- Type: Device
- OS: Android (Expo Go)
Additional context Repo: https://github.com/Dave-Wagner/ebike-adventures
Im having the same issue.
Same issue that was closed two weeks ago: https://github.com/mrzachnugent/react-native-reusables/issues/277
Do you have "userInterfaceStyle": "automatic" in your app.json?
Otherwise, can you please provide a minimal reproduction repo?
Yes, as you can see from the minimal reproduction repo I linked to in the original post.
edit: Oops, I hadn't heard a reply for a while so I went ahead and started a new repo with the same name, not using this library. Let me set up a new one following the directions and get back to you.
edit2: https://github.com/Dave-Wagner/starter-base
Unfortunately, I am unable to reproduce the error from https://github.com/Dave-Wagner/starter-base
https://github.com/user-attachments/assets/feb3c835-bbfc-42e6-9866-2f640e4d065c
I should point out that I am specifically using Expo Go, not the Android emulator, however, even create an EAS build using an APK I have the same problem on device. I am using a Google Pixel 9.
Edit: I just ran it on the Emulator in Windows and it works as expected. Perhaps it has to do with the version of Android on my Pixel 9.
Why complete this issue? It's clearly not resolved. There is clearly an issue,. It should be addressed.
Unfortunately, I am unable to reproduce the error from https://github.com/Dave-Wagner/starter-base
https://github.com/user-attachments/assets/feb3c835-bbfc-42e6-9866-2f640e4d065c
Would you be able to try it on an actual device? I'm wondering if it's only a bug there.
For reference, I have a samsung s23 and have the same issue using Expo Go or the full on development apk. The theme only changes when I change my phone's light/dark mode settings.
I know that if you just run the project and click 20 times or so, it changes the theme (I'm looking for a solution)
Well, I don't know if it's the best way to do this, but I created an alternative, because from what I noticed the position of the button was preventing the function from being executed, even debugging nothing was executed in the terminal, so I placed the same component on another page and it worked normally, in the gist there are 4 files, only 1 of them I created and the rest I just changed a few things, I hope it helps anyone who has this problem and if you have a better way to solve this problem, update me, please
https://github.com/user-attachments/assets/6f559e28-7590-4c41-b7a5-263a6aecb33b
I took another approach and tried replacing it with a different component and on the web it works fine but on native it doesn't even show up.
Edit: I figured out that I missed setting the color and stroke, oops. So it shows up but is still not clickable.
I am having the same issue. On the web it works fine, but on my actual device running a development built the toggle placed in the header doesn't work. If I put it in the index it works, so this would clearly point to an issue with the stack header
I am having the same issue. On the web it works fine, but on my actual device running a development built the toggle placed in the header doesn't work. If I put it in the index it works, so this would clearly point to an issue with the stack header
my solution was to create a customized header
I found solution it is expo bug. Replaced onPress by onPressIn and problem solved. https://github.com/expo/expo/issues/29489
I found solution it is expo bug. Replaced onPress by onPressIn and problem solved. expo/expo#29489
That's cool, thanks for the alternative
Closing due to not being a React Native Reusables issue