GeekyAnts / GeekyAnts/NativeBase

toggleColorMode is not working

Open
#5,729 0 comments 2 reactions 0 assignees View on GitHub
bug triage v3
Dominant language
TypeScript
Stars
20.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

### Description

toggleColorMode is not changing the background color.

### CodeSandbox/Snack link

-

### Steps to reproduce

1. Create a new Expo app.
2. Install native-base dependency.
3. Paste this code into the App.js file.
```
import {
NativeBaseProvider,
VStack,
Box,
Text,
Button,
useColorMode,
useColorModeValue,
} from 'native-base';

export default function App() {
const { colorMode, toggleColorMode } = useColorMode();
const text = useColorModeValue('Light', 'Dark');
const bg = useColorModeValue('warmGray.50', 'coolGray.800');

return (



Stopwatch

Toggle





);
}
```
4. Run the command "npx expo start".
5. Click on the toggle button.

### NativeBase Version

3.4.28

### Platform

- [X] Android
- [ ] CRA
- [ ] Expo
- [X] iOS
- [ ] Next

### Other Platform

Web

### Additional Information

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with the App.js example from the issue and reproduce the behavior in a new Expo app using NativeBase 3.4.28. Run npx expo start on Android and iOS, then trace the useColorMode and useColorModeValue behavior; done means pressing Toggle changes the Box background between the light and dark values.

Written by the indexing model from the issue text.

Assessment

Tech stack
react-native
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.