rv54ntjwfm3ug8

如何解决前端框架 MATERIAL-UI 暗色模式下切换页面闪一下的问题?

  •  
  •   rv54ntjwfm3ug8 · Apr 29, 2021 via iPhone · 1546 views
    This topic created in 2028 days ago, the information mentioned may be changed or developed.
    好像 React 没有完成加载前永远是亮色模式,导致会闪一下,这在环境暗的情况下用户体验极差。官方文档也有这问题,说明应该不是我的实现问题。请问有什么好的解决方案吗?
    2 replies  •  2021-04-29 12:09:13 +08:00
    noe132
    noe132
    Apr 29, 2021
    1
    在 html 的头部给 html 加一个暗色背景色。
    rv54ntjwfm3ug8
    rv54ntjwfm3ug8
    OP
    Apr 29, 2021 via iPhone❤️1
    2
    @noe132 #1 那用户在亮色模式下切换页面也会闪一下。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2517 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 11:51 · PVG 19:51 · LAX 03:51 · JFK 06:51
    ♥ Do have faith in what you're doing.