Remove unused isPending from RouterContext#28
Closed
kentcdodds wants to merge 3 commits into
Closed
Conversation
Pending UI is derived by comparing location and nextLocation, so isPending from useTransition was never read from context. Drop it from context values, use a discarded binding for useTransition, and update the pending-ui exercise notes. Co-authored-by: Cursor <cursoragent@cursor.com>
Keep isPending in RouterContext and combine it with location vs nextLocation comparisons so pending states only show during an active transition. Update the pending-ui exercise notes accordingly. Fixes #27 Co-authored-by: Cursor <cursoragent@cursor.com>
Drop isPending from RouterContext in exercises after the pending-ui step, where pending state is derived from location vs nextLocation. Leave the pending-ui exercise unchanged. Fixes #27 Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #27
Summary
isPendingfromuseTransitionintoRouterContextacross router and actions exercisesconst [, startTransition] = useTransition()since onlystartTransitionis neededlocationandnextLocationinsteadTest plan
locationvsnextLocation(e.g. ship search, ship details)startTransitionfor content updatesMade with Cursor
Note
Low Risk
Low risk: removes an unused context value and adjusts
useTransitiondestructuring without changing navigation or transition behavior.Overview
Removes
isPendingfrom theRouterContextvalue across multiple router/actions exercises, since these modules only rely onstartTransitionand track pending UI vialocationvsnextLocation.Updates each affected
Rootcomponent to destructureuseTransition()asconst [, startTransition] = useTransition()and stops passingisPendingthrough context.Reviewed by Cursor Bugbot for commit 2b3e81c. Bugbot is set up for automated code reviews on this repo. Configure here.