Repository navigation
feat: support Next.js 13.4+ and React 18.2+ - #45
Merged
Merged
Conversation
StackLink handles the click itself instead of Link's onNavigate (Next.js 15.3+), StackLink and StackMotion forward refs on React 18, inert renders in the form each React version accepts, and withStackflow only adds the Cache Components and Partial Prefetching keys on Next.js versions that know them. Top-level types and typesVersions let older TypeScript module resolution find the declarations. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.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.
Widens the peer range from Next.js 16.4.6+/React 19.3.1+ to Next.js 13.4+ (App Router) and React 18.2+.
StackLinkhandles the click itself instead of Link'sonNavigate, which only exists from Next.js 15.3. Modified, middle, new-tab and download clicks still go to the browser, andonNavigatecancellation still works.StackLinkandStackMotionuseforwardRefso refs work on React 18.inertis rendered as a boolean on React 19 and as an empty string on React 18.withStackflowaddscacheComponentsonly on Next.js 16+ andpartialPrefetchingonly on 16.3+.types/typesVersionslet Next 13.4's forcedmoduleResolution: nodefind the declarations.Checked: 67 unit tests pass. A test app that uses every export was packed and built against Next 13.4.0, 13.5.11, 14.2.35, 15.1.0, 15.5.29, 16.0.0 and 16.4.6 with matching React 18.2–19.3. In the browser, on 13.4, 13.5, 14.2, 15.1 and 16.4, the link slide and back slide ran, there was no full reload,
onNavigatecancel stayed put, refs andinertworked,useStackStatesurvived Back, and the console had no errors.No release in this PR; it goes out with the Monday batch.
🤖 Generated with Claude Code