Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Clarify when Effects are needed for data fetching (#8226) #8238

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
kanikaa88 wants to merge 1 commit into reactjs:main
base: main
Choose a base branch
Loading
from kanikaa88:fix-fetching-data-explanation-8226

Conversation

@kanikaa88
Copy link

@kanikaa88 kanikaa88 commented Jan 13, 2026

This PR improves the explanation in the "Fetching data" section of "You Might Not Need an Effect" to clarify when an Effect is needed versus when it's not.

The previous text was confusing because it said "You don't need to move this fetch to an event handler" which seemed contradictory given the page's title. This change:

  • Clearly states that this IS a case where an Effect IS needed (for synchronization with external system)
  • Explains the key difference: Effects are needed when synchronizing with external systems, regardless of how the state changes
  • Adds a contrast example showing when you would use an event handler instead

This makes it clearer for readers to understand when Effects are appropriate for data fetching.

Closes #8226

Copy link

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! 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

[Mistake]: Wrong example in fetching data section on You Might not need a Effect Page

1 participant

AltStyle によって変換されたページ (->オリジナル) /