Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quick glitch/transition showing light mode temporarily (when I am already in dark mode) - when refreshing or first loading the page in react native web (via expo) #82

Closed
ammarfaris opened this issue Dec 14, 2023 · 8 comments
Labels
bug Something isn't working good first issue Good for newcomers
Milestone

Comments

@ammarfaris
Copy link

Description

Quick glitch/transition showing light mode temporarily (when I am already in dark mode) - when refreshing or first loading the page in react native web (via expo) ; toggling dark-light mode via the actual dark-light mode toggle works fine

glitch.mov

Steps to reproduce

  1. Run npx create-expo-app my-app and choose Navigation (Typescript) for expo-router version
  2. Follow the setup guide at unistyles setup page
  3. Add code to test light-dark mode (sample given in unistyles doc)
  4. Run yarn web and try to refresh the web page

Snack or a link to a repository (optional)

No response

Unistyles version

2.0.0

React Native version

0.72.6

Platforms

React Native Web

Engine

Hermes

Architecture

Paper (old)

@jpudysz
Copy link
Owner

jpudysz commented Dec 14, 2023

Should be easy to fix, thank you for the report 🙇‍♂️

@jpudysz jpudysz added bug Something isn't working good first issue Good for newcomers labels Dec 15, 2023
@jpudysz jpudysz added this to the 2.0 milestone Dec 15, 2023
@jpudysz
Copy link
Owner

jpudysz commented Dec 15, 2023

Hello,

I was unable to reproduce your issue.

I have created a repository with the correct setup: https://github.com/jpudysz/react-native-unistyles-expo-router.

You just need to avoid mixing Expo's theming with Unistyles. In this repository, everything is converted to Unistyles and works as intended.

@jpudysz jpudysz closed this as completed Dec 15, 2023
@ammarfaris
Copy link
Author

Hello,

I was unable to reproduce your issue.

I have created a repository with the correct setup: https://github.com/jpudysz/react-native-unistyles-expo-router.

You just need to avoid mixing Expo's theming with Unistyles. In this repository, everything is converted to Unistyles and works as intended.

Thanks @jpudysz for creating the repository, appreciate it very much!

My apology - I missed one information, I was also testing Expo SDK 50 Beta + Expo Router v3 Beta at that time and I just realized that I have upgraded my project to Expo SDK 50 Beta by running commands below - from "Using the Beta" section in this announcement page:

yarn add expo@next

npx expo install --fix

So when I run that in your repo, the flickering / glitch came back ; Maybe once SDK50 is out of Beta, we can revisit this. Thanks for your help and effort!

@jpudysz
Copy link
Owner

jpudysz commented Dec 15, 2023

No worries! I'm glad that I could narrow the issue to V3

@annidai
Copy link

annidai commented Apr 26, 2024

Hi @jpudysz , I’m also experiencing the same issue with Expo SDK 50 and Expo-router v3. Now that SDK 50 is officially released, would it be more appropriate to open a new issue or should we consider reopening this one?

@jpudysz
Copy link
Owner

jpudysz commented Apr 26, 2024

Hey, can you create a repro with v3? I don't think it's Unistyles issue as it provides colors before the render, maybe something specific for the Expo Router.

@annidai
Copy link

annidai commented Apr 30, 2024

Hey, can you create a repro with v3? I don't think it's Unistyles issue as it provides colors before the render, maybe something specific for the Expo Router.

Hey @jpudysz, after taking a closer look, it seems that setting the system UI background and applying a background color to the root stack resolves the issue. Thank you for the help!

@jpudysz
Copy link
Owner

jpudysz commented Apr 30, 2024

You resolved the mystery of Expo Router v3! Thank you for your reply! ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants