question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Theme switching doesn't work with Remix

See original GitHub issue

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Current behavior 😯

The theme in ErrorBoundary and CatchBoudnary of remix doesn’t match with rest of the app.

Expected behavior 🤔

The theme selected should be respected in ErroBoundary and CatchBoundary too.

Steps to reproduce 🕹

Steps:

  1. Visit the codesandbox
  2. Toggle the theme to dark if not already
  3. Hit the Test Root CatchBoundary link
  4. You’ll see the dark theme but if you refresh the page, the theme will fallback to light for some reason and you’ll see Warning: Prop 'content' did not match. Server: "#90caf9" Client: "#1976d2" in the console. This warning is regarding the <meta name="theme-color" content={theme.palette.primary.main} /> tag in the root.

Context 🔦

I am trying to accomplish a successful MUI theme switch with error and catch boundaries too.

Your environment 🌎

`npx @mui/envinfo`
  System:
    OS: Linux 5.4 Debian GNU/Linux 10 (buster) 10 (buster)
  Binaries:
    Node: 16.12.0 - ~/.nvm/versions/node/v16.12.0/bin/node
    Yarn: 1.22.17 - ~/.nvm/versions/node/v16.12.0/bin/yarn
    npm: 8.1.0 - ~/.nvm/versions/node/v16.12.0/bin/npm
  Browsers:
    Chrome: Not Found
    Firefox: Not Found
  npmPackages:
    @emotion/react: ^11.7.1 => 11.7.1
    @emotion/styled: ^11.6.0 => 11.6.0
    @mui/base:  5.0.0-alpha.69
    @mui/icons-material: ^5.4.1 => 5.4.2
    @mui/material: ^5.4.1 => 5.4.2
    @mui/private-theming:  5.4.2
    @mui/styled-engine:  5.4.2
    @mui/system:  5.4.2
    @mui/types:  7.1.2
    @mui/utils:  5.4.2
    @types/react: ^17.0.38 => 17.0.39
    react: ^17.0.2 => 17.0.2
    react-dom: ^17.0.2 => 17.0.2
    typescript: ^4.5.4 => 4.5.5

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:29 (11 by maintainers)

github_iconTop GitHub Comments

4reactions
arpitdalalcommented, Mar 16, 2022
2reactions
arpitdalalcommented, Mar 15, 2022

@mnajdova I fixed the useEnhancedEffect_default is not a function by creating my own useEnhancedEffect hook similar to MUI’s. Here’s the fixed-codesandbox-latest with latest @mui/material version and custom useEnhancedEffect hook

I think it is esbuild not building MUI dependencies into the build or similar and that’s why things are not a function.

I will close this issue since it is “resolved”. esbuild problem needs its own issue to keep track of it. Thanks very much for the support!

Read more comments on GitHub >

github_iconTop Results From Across the Web

The Complete Guide to Dark Mode with Remix
Adding dark mode without a toggle. Remix makes it unbelievably easy to add a theme based on the user's system preferences. Creating a...
Read more >
Setting up Dark Theme with Remix and Stitches - Ross Moody
Set up the theme switcher​​ The last piece of the puzzle is to put a Button on a route that changes the cookie's...
Read more >
Remix-IDE Layout — Remix - Ethereum IDE 1 documentation
So you want to work on Remix with a dark theme or a light theme or just a different theme than the one...
Read more >
Styling
In our experience, writing plain CSS had maintenance issues for a few reasons. ... styles change, browser and CDN caches for the other...
Read more >
How to dynamically change tailwindcss theme color using ...
I'm using tailwindcss with Remix.run and trying to figure out how can I change ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found