Conversation
Prompt: Looking at @compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/stable-handler/stable-handler-prop-basic.expect.md -- I see two potential problems. It looks to me like the onClick that is being passed to <button> will be re-created whenever `value` changes. It also looks like `t1` is only capturing the value of `onSubmit` when `value` changes. What we want instead is for `onClick` to never update, and to always capture the latest values of `value` and `onSubmit`.
|
This isn’t something we plan to support, at least not in the way it’s used in the fixtures. This NonReactive annotation appears intended to let you drop reactivity, like many frameworks notion of “untracked”, which our experience suggests is a footgun. |
|
Thanks for the response, and understood! Creating this PR was an accident; It's not something I intended to submit upstream -- it's just something I am experimenting with. Our codebase heavily uses a custom hook based on the |
|
I'm aware of that, but my understanding is that it won't work for our use cases. It is only intended to be used within
and
I'm not familiar with the history of what changed between that original RFC and shipping of the more limited approach in React 19.2. Our codebase has seen a lot of great performance improvements from our implementation of |
Summary
How did you test this change?