PaperProvider theme doesn't work for release build on IOS
See original GitHub issueFor debug build it show my custom theme but for release it shows purple color instead of mine.
Version:
"react": "16.8.1",
"react-native": "0.61.3",
"react-native-paper": "3.1.1",
Code:
import {DefaultTheme, Provider as PaperProvider} from 'react-native-paper';
const theme = {
...DefaultTheme,
roundness: 7,
dark: true,
mode: 'adaptive',
colors: {
...DefaultTheme.colors,
primary: Colors.mantis,
accent: Colors.nero,
},
};
const logger = createLogger();
const persistedReducer = persistReducer(persistConfig, reducers);
const store = createStore(persistedReducer, {}, applyMiddleware(ReduxThunk, logger));
const persistor = persistStore(store);
const App = () => (
<StoreProvider store={store}>
<PersistGate persistor={persistor}>
<PaperProvider theme={theme}>
<App />
</PaperProvider>
</PersistGate>
</StoreProvider>
);
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
React Native Paper Dark Theme on IOS - Stack Overflow
To employ a dark theme in your app, Paper provides a Material based DarkTheme. You can specify which theme to use within the...
Read more >Theming · React Native Paper
We are planning to provide a better support of handling custom theme overrides in future releases. Simple built-in theme overrides. You can provide...
Read more >[Solved]-React Native Paper Dark Theme on IOS-React Native
Coding example for the question React Native Paper Dark Theme on IOS-React Native.
Read more >React Navigation v5 + React Native Paper = ❤️
It means I won't show you how to build all of the components necessary ... The PaperProvider provides the theme to all the...
Read more >5 Easy Methods to Implement Dark Mode in React Native
Android 10 and iOS 13 brought native support of dark mode to the most ... in-built module Appearance that provides users' theme preferences....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@kevinsoellner try resetting metro cache:
react-native start --reset-cache
orexpo start -c
if using expoHas this been fixed? I’m getting the same error when I build for release via Xcode:
I just updated to the latest npm version and tried pod install again. Still getting the same error message even after resetting cache.
EDIT
I figured out my problem. I just assumed since it was talking about Portal.Host, it was related to react-native-paper, especially since someone else had a similar problem. Turns out that I forgot to add a native module manually to my project since I switched computers (library was an ad library, so I just need to download that from their repo and add it to Xcode). Once I commented out my NativeModules code, release started working again. It’s because I added a flag to my code
if (__DEV__) { return }
.