Skip to content

SSR: Theme Usage Investigation (dark mode initial flicker) #31

Closed

Description

@Alessandro100

MUI handles theme values with SSR quite well when used like
<Button color=’primary’>. The current state is when we want to access theme properties we add the hook const theme = useTheme() but this is a Client Only hook, we need something for SSR friendly. MUI offers CSS Variables that are SSR friendly and is most likely the way. Early tests showed promise, but required more tweaking for V1

A problem that we are currently facing is, on initial load for users with dark mode, the page will start in light mode then flicker to dark mode (bad UX)

Objective: Find a way / system to best use theme styles in server components

A good component to look at would be the Footer

Activity

  1. changed the title [-]SSR: Theme Usage Investigation[/-] [+]SSR: Theme Usage Investigation (dark mode initial flicker)[/+] on Mar 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions