Fix: lazy section - #1369
Fix: lazy section#1369
Conversation
WalkthroughUpdated Lazy rendering in website/sections/Rendering/Lazy.tsx to handle nullable sections, pass URL search params into shouldForceRender, use optional chaining for fallback/metadata, and early-return null when no section. Eager rendering path unchanged. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant R as Request/Route
participant L as Lazy Component
participant LD as Loader
participant SFR as shouldForceRender
participant UI as UI
R->>L: Render Lazy({ section, loading, ctx, url })
alt loading === "eager"
L->>UI: Render section immediately
else loading === "lazy"
L->>LD: load({ ctx, section })
LD->>SFR: shouldForceRender({ ctx, searchParams: url.searchParams })
SFR-->>LD: true/false
alt force === true
LD-->>L: resolvedSection (may be null)
else
LD-->>L: resolvedSection (deferred/conditional)
end
alt resolvedSection == null
L-->>UI: null (no render)
else resolvedSection present
L->>UI: Render resolvedSection with fallback = resolvedSection?.LoadingFallback<br/>or defaultFallbackFor(component || "unknown")
end
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🔇 Additional comments (3)
✨ Finishing Touches
🧪 Generate unit tests
Comment |
Tagging OptionsShould a new tag be published when this PR is merged?
|
Summary by CodeRabbit
New Features
Bug Fixes