-
-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Stabilize useRevalidator #10707
Stabilize useRevalidator #10707
Conversation
🦋 Changeset detectedLatest commit: b9eed2d The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@@ -909,107 +909,6 @@ describe("createMemoryRouter", () => { | |||
}); | |||
}); | |||
|
|||
it("reloads data using useRevalidator", 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.
Existing tests extracted to `use-revalidator-test.tsx
expect(router.state.errors).toBe(null); | ||
}); | ||
|
||
it("is stable across location changes", 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.
Net new functionality test
return React.useMemo( | ||
() => ({ | ||
revalidate: dataRouterContext.router.revalidate, | ||
state: state.revalidation, | ||
}), | ||
[dataRouterContext.router.revalidate, state.revalidation] | ||
); |
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.
This is the only functional change in this PR
Closes #10706
I also restructured some unit tests in 28d8eed. Began with pulling out
useRevalidator
tests from the largerdata-memory-router-test
and then that led to moving some utils to standalone files and leveraging them instead of copy/pasting them across test suites.