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

web: fix theme flashing #27385

Closed
wants to merge 1 commit into from
Closed

web: fix theme flashing #27385

wants to merge 1 commit into from

Conversation

valerybugakov
Copy link
Member

@valerybugakov valerybugakov commented Nov 10, 2021

Context

Because the global theme class was added in the useEffect after the initial DOM tree render, it caused the CSS transition on some elements.

Changes

  • Global theme class is now added via a synchronous function that's memoized to prevent redundant DOM updates.
  • A small dependency (400b) was added to use a proper memoization function. See here why the lodash equivalent is not enough here. A proper memorization function would be useful in other places.

Closes #26435

@valerybugakov valerybugakov added bug An error, flaw or fault that produces an incorrect or unexpected result, or behavior. frontend-platform Issues related to our frontend platform, owned collectively by our frontend crew. labels Nov 10, 2021
@valerybugakov valerybugakov self-assigned this Nov 10, 2021
@cla-bot cla-bot bot added the cla-signed label Nov 10, 2021
@valerybugakov valerybugakov marked this pull request as ready for review November 11, 2021 07:29
@valerybugakov valerybugakov deleted the vb/fix-theme-flash branch November 11, 2021 07:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error, flaw or fault that produces an incorrect or unexpected result, or behavior. cla-signed frontend-platform Issues related to our frontend platform, owned collectively by our frontend crew.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feedback and command line button in nav flash on page load
1 participant