Skip to content

Document side effects in lazy initialization - #8679

Open
Mahendra-2006 wants to merge 1 commit into
reactjs:mainfrom
Mahendra-2006:docs/issue-8677
Open

Mahendra-2006 wants to merge 1 commit into
reactjs:mainfrom
Mahendra-2006:docs/issue-8677

Conversation

@Mahendra-2006

Copy link
Copy Markdown

Fixes #8677

Adds an example showing why performing external side effects during lazy initialization/render can be problematic, and demonstrates the correct approach of using an Effect for resources that require setup and cleanup.

@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown

Size changes

Details

📦 Next.js Bundle Analysis for react-dev

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

karthik-awebon

This comment was marked as off-topic.

This branch was successfully deployed

1 active deployment
Preview — 2ec5611f Deployed Oct 1, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Suggestion]: lazy initialization example can encourage unsafe patterns - show example

2 participants