根因:expandedKeys 的 useState 调用位于 "if (!isAuthenticated) return null" 之后,违反 Rules of Hooks。认证状态变化时 hooks 调用数量不一致, React 报 #310 "Cannot update a component while rendering a different component"。 修复:将 activeKey 计算和 expandedKeys useState 全部移至条件 return 之前, 确保每次渲染 hooks 调用顺序完全一致。 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| admin-app | ||
| admin-web | ||
| genex-mobile | ||
| miniapp/src | ||
| mobile | ||
| portal | ||
| .gitignore | ||
| build.bat | ||
| build.sh | ||