Comments (4)
我在next.config.js中开启了reactStrictMode: true, 每个组件都会渲染2次, 是不是这个原因
from nextjs13-with-antd-tailwindcss.
我也把reactStrictMode设置false了,我试了你的项目也是渲染多次,我加了如下代码测试:
console.log("render")
useEffect(() => {
console.log("mount")
return () => {
console.log("unmount")
}
},[])
from nextjs13-with-antd-tailwindcss.
哦,我好像找到了问题,代码中
if (!mounted) {
// use your loading page
return (
<div className="hidden">
{props.children}
</div>
);
}
{props.children}是不是要把这个改成加载页面,我去掉就正常了,非常感谢回复
from nextjs13-with-antd-tailwindcss.
我设想中这里应该是在服务器端执行的代码,本意是传输可供搜索引擎抓取的页面信息,加速首屏渲染
from nextjs13-with-antd-tailwindcss.
Related Issues (4)
- why antd with tailwind? HOT 7
- Antd style problems in dark mode HOT 2
- 页面白屏时间久 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nextjs13-with-antd-tailwindcss.