Skip to content

Conversation

@rickhanlonii
Copy link
Member

@rickhanlonii rickhanlonii commented Jan 30, 2026

Preview

Used the new claude skills to revamp the useEffectEvent docs, then did a human pass.

If you're interested, the first commit is claude's attempt, and the second commit is my edits.

Here's the PR with the claude improvements this used: #8280

@github-actions
Copy link

github-actions bot commented Jan 30, 2026

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

@rickhanlonii rickhanlonii mentioned this pull request Jan 30, 2026
@MaxwellCohen
Copy link

I do not know if it is this page or the You Might Not Need an Effect page, but there should be somewhere that explains where you would and would not use useEffectEvent more explicitly.

@gaearon
Copy link
Member

gaearon commented Jan 30, 2026

Here’s the original doc that spells out the motivation more clearly: https://react.dev/learn/separating-events-from-effects#declaring-an-effect-event

I agree that this reference page should ideally convey this (but shorter). Reading it now as it is, I don’t have a clear sense of what problem it solves. I do get this sense from the original doc so the challenge is how to compress it.

Copy link

@stephan-noel stephan-noel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. Just left 2 small things.


#### Parameters {/*parameters*/}

* `callback`: A function containing the logic for your Effect Event. The function can accept any number of arguments and return any value. When you call the returned Effect Event function, the `callback` always accesses the latest values from props and state at the time of the call.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I guess it's not only props and state, but anything from the surrounding closure? At least that's what I understood by looking at packages\react-reconciler\src\ReactFiberHooks.js and packages\react-reconciler\src\ReactFiberCommitWork.js in the main repo. Maybe most people won't read into it that much.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants