在 React 嚴格模式下,RedocStandalone 会泄露 AppStore 滚动监听器(存储内置的 useMemo 函数)
作者: BillSchumacher创建于 2026年9月23日更新于 2026年9月23日
Describe the bug
Under React Strict Mode (for example, Next.js App Router in development), <RedocStandalone> leaks AppStore instances. Each leaked store keeps a window scroll listener attached after the component unmounts, so scrolling any later page keeps rewriting the URL hash to a Redoc anchor such as #tag/…/operation/…. The same double-invoke also disposes the store that's actually rendered, so the mounted reference loses its own scroll-spy in development.
内容来源: Redocly/redoc