fix: replace deep RN imports with public API - #744
Open
leotm wants to merge 1 commit into
Open
Conversation
leotm
marked this pull request as ready for review
July 21, 2026 16:22
leotm
commented
Jul 28, 2026
leotm
left a comment
Author
There was a problem hiding this comment.
didn't commit the import updates 🤦♂️
leotm
added a commit
to leotm/react-native-safe-area-context
that referenced
this pull request
Jul 28, 2026
- replace imports from RN internal paths (react-native/Libraries/Types/CodegenTypes, react-native/Libraries/Utilities/codegenNativeComponent) with public API exports - fix implicit any type in SafeAreaContext cb param and avoid InstanceType on codegen component by using Component<Props> directly
leotm
force-pushed
the
replace-deep-rn-imports-with-public-api
branch
from
July 28, 2026 15:12
43b2f7d to
9879709
Compare
- replace imports from RN internal paths (react-native/Libraries/Types/CodegenTypes, react-native/Libraries/Utilities/codegenNativeComponent) with public API exports - fix implicit any type in SafeAreaContext cb param and avoid InstanceType on codegen component by using Component<Props> directly
leotm
force-pushed
the
replace-deep-rn-imports-with-public-api
branch
from
July 28, 2026 16:41
9879709 to
6612ea2
Compare
huntie
reviewed
Jul 30, 2026
Contributor
There was a problem hiding this comment.
Thanks @leotm!
✅ Endorsed
However, this is a breaking change as it'll require RN >= 0.82, which introduces CodegenTypes. cc @janicduplessis
(Note: not 0.80, it needs slightly revised types from >= 0.82.)
"peerDependencies": {
"react": "*",
- "react-native": "*"
+ "react-native": ">=0.82.0"
},Non-breaking fix: #745
Fundamentally this issue should only be happening when this repository upgrades react-native for its typechecking, however the root issue is that the jest/mock subpath breaks encapsulation. I've opened this separate PR which can be landed as a non-breaking change fix for the user side.
(In contrast, this PR fixes the library's own codebase.)
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.
Context
Fix: leotm/react-native-template-new-architecture#2041
Fix: #743