Repository navigation
chore: update the Lynx toolchain and drop the ref bridge - #10
Merged
Merged
Conversation
ReactLynx 0.126 moves from Preact 10 to 11. Preact 10 pulled `ref` out of props in createElement and pointed it at the component instance, so `BaseNavigationContainer`, which takes `ref` as a plain prop the way React 19 does, never saw it - `useImperativeHandle` ran against undefined and the caller got a Preact instance with no `getRootState`. Preact 11 delivers ref as a prop, so the container hands `useLinking` its own ref and LinkingBridge goes away. react-rsbuild-plugin has to move too: 0.19.1 peers on 0.124/0.125 only.
🦋 Changeset detectedLatest commit: b9c140a The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
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.
Every
@lynx-js/*package to its current release. The one that matters isReactLynx 0.126, which moves from Preact 10 to 11.
Preact 10 pulled
refout of props increateElementand pointed it at thecomponent instance.
BaseNavigationContainertakesrefas a plain prop —the way React 19 delivers it — so it never saw one:
useImperativeHandleranagainst
undefined, and the caller got a Preact instance with nogetRootState. That is why the container published its handle throughNavigationContainerRefContextinstead.Preact 11 delivers ref as a prop, so
LinkingBridgegoes away and thecontainer hands
useLinkingits own ref, matching@react-navigation/native.react-rsbuild-pluginhas to move with it — 0.19.1 peers on 0.124/0.125 only.Verified on a Pixel 5: a cold start lands on the linked route, and a warm one
navigates onto the existing stack — the path that needs
ref.current.One thing to know: the demo still aliases
reactto this package's compatshim rather than
@lynx-js/react/compat. The official entry makes themain-thread render throw
cannot read property '__cC7' of undefinedinsideuse(NavigationStateContext); the shim'suse = useContextdoes not.