Giter VIP home page Giter VIP logo

Comments (3)

marklawlor avatar marklawlor commented on June 8, 2024 1

@snowdigital I'm confused about your issue, could you be more specific? If I make the following change the repo provided, the background changes to green as expected.

- <ThemeProvider value={DarkTheme}>
+ <ThemeProvider
+   value={{
+     ...DarkTheme,
+     colors: {
+       ...DarkTheme.colors,
+       background: "green",
+     },
+    }}
+ >

If you are referring to the flash of white while changing screens (e.g opening the modal), it's because React Navigation only styles its own components - you still have the standard system background color. You can control by wrapping your application in a View

+ <View style={[StyleSheet.absoluteFill, { backgroundColor: 'red' }]}>
  <ThemeProvider value={DarkTheme}>
    { ... }
 </ThemeProvider>
+ </View >

from router.

marklawlor avatar marklawlor commented on June 8, 2024

@snowdigital I'm assuming you are using the Tabs example ( npx create-expo-app@latest --template tabs@sdk-49)? It has a custom View and Text component that uses the colors from constants/Colors.ts.

Expo Router will work with <ThemeProvider /> 👍

I'm going to close this issue, as I think there was a slight misunderstand with the demo, but if that's not the case can you provide a repo with your source code and I'll reopen this issue.

from router.

snowdigital avatar snowdigital commented on June 8, 2024

@marklawlor

@snowdigital I'm assuming you are using the Tabs example ( npx create-expo-app@latest --template tabs@sdk-49)? It has a custom View and Text component that uses the colors from constants/Colors.ts.

Expo Router will work with <ThemeProvider /> 👍

I'm going to close this issue, as I think there was a slight misunderstand with the demo, but if that's not the case can you provide a repo with your source code and I'll reopen this issue.

Here you go :)
https://github.com/snowdigital/expo-router-background-bug-example

I think its related to Root background color. react-navigation was using theme provider to set background of root View, but i assume that expo router just wraps screens in selected theme. Issue only reproducable when in code you use Static dark theme instead of useColorScheme native styling.

video_2023-08-31_12-45-27.mp4

from router.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.