ant-design / ant-design/pro-components

🧐[问题] SSR 项目使用ProLayout渲染,在屏幕宽度大于990的时候,可以正常显示,但是小于990宽度,就报错

Open
#8,916 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
4.8k
Forks
1.4k
Avg merge
10h 44m
Merged PRs (30d)
3

Description

### 🧐 问题描述

SSR 项目使用ProLayout渲染,在屏幕宽度大于990的时候,可以正常显示,但是在屏幕**初始化(设置好宽度,直接刷新)**宽度小于990,就报错 Cannot read properties of null (reading 'children')
![image](https://github.com/user-attachments/assets/1a0d999b-3ebb-47bd-bfd6-a4faf1c7823c)
我把ProLayout 替换为普通的div,或者ant design 的button 在任意宽度都可以正常显示。

### 版本信息
pro-components :2.7.0

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the ProLayout SSR case at an initial viewport below 990px, using pro-components 2.7.0, and compare it with the same page above 990px. Trace the ProLayout rendering path around the Cannot read properties of null (reading 'children') error; done means the page renders without that error at both viewport sizes.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.