第一次加载时nextjs丑陋的CSS

问题描述

您好,我们正在做一个小项目,正在将 const skills = ["javascript","Nginx"]; const skillsSet = new Set(skills); const allSkills = [{ _id: 'fa59424f3d6532ae63fad26',category: 'Web Development',name: 'wordpress',path: 'wordpress.svg',__v: 0 },{ _id: 'fa5979c9e84032b92d3e9ee',category: 'DevOps',name: 'Nginx',path: 'Nginx.svg',{ _id: 'fa597b79e84032b92d3e9ef',name: 'javascript',path: 'javascript.svg',]; const allDevOpsSkills = allSkills .filter((e) => e.category == "DevOps") .map((n) => ({ name: n.name,path: n.path })); const allWebDevSkills = allSkills .filter((e) => e.category == "Web Development") .map((n) => ({ name: n.name,path: n.path })); const userWebDevSkills = allWebDevSkills.filter(n => skillsSet.has(n.name)); console.log(userWebDevSkills);nextjs库一起使用,并且遇到了CSS的问题,当网站首次加载或刷新浏览器时,网站加载丑陋而没有css 2到3秒钟,我不知道该如何解决,我做了很多搜索,没有找到防止这种情况发生的解决方

chakra-ui

_app.js

function MyApp({ Component,pageProps }) { const [load,setLoad] = React.useState(true); const store = useStore(pageProps.initialReduxState); const persistor = persistStore(store); return ( <Provider store={store}> <PersistGate loading={<Component {...pageProps} />} persistor={persistor}> <ChakraProvider theme={theme}> <Component {...pageProps} /> </ChakraProvider> </PersistGate> </Provider> </> ); } export default MyApp;

-document.js

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...