Comments (2)
@aswinmohanme you can use React-Native's Appearance API. Considering you are using mobx, I would setup a listener in one of your stores and listen to appearance changes, keep track of it in the store and maybe use context to setup a useAppearance
or useColorScheme
hook. Then in your codebase, you can do something like this:
const colorScheme = useColorScheme() // "dark" | "light"
<Button color={colorScheme === "dark" ? "white" : "black"} />
You may want to look at something like theme-ui to setup proper theming support to avoid having ternaries everywhere though.
from ignite-bowser.
@aswinmohanme how did you end up implementing the theme switching?
from ignite-bowser.
Related Issues (20)
- Remove navigator generator script HOT 2
- react-native-viewpager - Couldn't find a navigation context
- module `Libraries/Image/AssetRegistry` could not be found HOT 2
- Newly generated app: detox build does not work HOT 2
- Why screens generated with ignite generate screen do not extend React.Component? HOT 1
- App won't build just after ignite HOT 5
- shorthand ".." import on mobx-state-tree model definition file is causing cryptic error HOT 3
- Navigating from mobx-state-tree model actions HOT 2
- text-field.props.ts causing type warnings HOT 1
- Unable to ignite new project when Expo is set to true HOT 1
- Trouble generating app with ignite 6.0 HOT 2
- Delete
- Jest: npm run test not working with node_modules that use ES6 import syntax HOT 1
- o is not a function. (In 'o()', 'o' is undefined) HOT 5
- Detox is missing for expo
- Error: [MobX] Cannot apply '@action' to 'ComplexType.prototype.create' HOT 1
- Persist store data HOT 2
- Not able to run latest ignite app on macbook with M1 chip HOT 1
- Storybook Not Loading with Expo Ignite
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ignite-bowser.