-
Notifications
You must be signed in to change notification settings - Fork 47k
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
[crud] Basic implementation #31523
[crud] Basic implementation #31523
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Comparing: 92c0f5f...21619eb Critical size changesIncludes critical production bundles, as well as any change greater than 2%:
Significant size changesIncludes any change greater than 0.2%: Expand to show
|
packages/react-reconciler/src/__tests__/ReactHooksWithNoopRenderer-test.js
Show resolved
Hide resolved
packages/react-reconciler/src/__tests__/ReactHooksWithNoopRenderer-test.js
Show resolved
Hide resolved
}); | ||
|
||
// @gate enableUseResourceEffectHook | ||
it('calls update on every render if no deps are specified', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh didn't realize we were supporting this case in my comment above. Should we require null
to be more explicit, or would you rather follow the current useEffect pattern for now? If we are more explicit while introducing this, it will be easier to compile later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking that since we would eventually move to an overload, it'd be better to keep the existing pattern since that's in line with the existing mental model of how effect dependencies work
packages/react-reconciler/src/__tests__/ReactHooksWithNoopRenderer-test.js
Outdated
Show resolved
Hide resolved
Scaffolds the initial `useResourceEffect` dispatcher type. This will eventually be folded into `useEffect` et al as an overload. --- [//]: # (BEGIN SAPLING FOOTER) Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/facebook/react/pull/31555). * #31523 * #31557 * #31556 * __->__ #31555
Adds a new feature flag for `enableUseResourceEffectHook`. --- [//]: # (BEGIN SAPLING FOOTER) Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/facebook/react/pull/31556). * #31523 * #31557 * __->__ #31556 * #31555
Adds a new `Effect` type which for now just points to the `SimpleEffect` type, in prepartion for later in the stack where we add more. --- [//]: # (BEGIN SAPLING FOOTER) Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/facebook/react/pull/31557). * #31523 * __->__ #31557 * #31556 * #31555
This PR introduces a new experimental hook `useResourceEffect`, which is something that we're doing some very early initial tests on. This may likely not pan out and will be removed or modified if so. Please do not rely on it as it will break.
Adds a new `Effect` type which for now just points to the `SimpleEffect` type, in prepartion for later in the stack where we add more. --- [//]: # (BEGIN SAPLING FOOTER) Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/facebook/react/pull/31557). * #31523 * __->__ #31557 * #31556 * #31555 DiffTrain build for [053b3cb](053b3cb)
Adds a new `Effect` type which for now just points to the `SimpleEffect` type, in prepartion for later in the stack where we add more. --- [//]: # (BEGIN SAPLING FOOTER) Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/facebook/react/pull/31557). * #31523 * __->__ #31557 * #31556 * #31555 DiffTrain build for [053b3cb](053b3cb)
This PR introduces a new experimental hook
useResourceEffect
, which is something that we're doing some very early initial tests on.This may likely not pan out and will be removed or modified if so. Please do not rely on it as it will break.