fix: add typeof guard for getBoundingClientRect in useBoundingClientRect#2626
Open
magrinj wants to merge 1 commit intogorhom:masterfrom
Open
fix: add typeof guard for getBoundingClientRect in useBoundingClientRect#2626magrinj wants to merge 1 commit intogorhom:masterfrom
magrinj wants to merge 1 commit intogorhom:masterfrom
Conversation
|
I am experiencing this issue as well. I believe it started happening on Expo SDK 55. |
|
@SellersEvan what version are you on? It seems fixed in v5.2.8 |
|
@chukwumaokere Just updated and the issues seems to be resolved. Thanks! That's the first thing I should of check. |
|
I'm having this exact same issue and had to patch using this type of fix |
|
This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 10 days. |
Contributor
Author
|
Seems to still occur regarding the comments |
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.
PR #2561 fixed the
unstable_getBoundingClientRectpath (line 58) by adding atypeof === 'function'guard, but the fallbackgetBoundingClientRectpath (line 71) was missed, it still only checks!== null.In
react-test-renderer,nativeFabricUIManageris set to{}by React Native's jest setup (react-native/jest/setup.jsline 36), which makesisFabricInstalled()returntrue. This causes theuseBoundingClientRecthook to execute the Fabric code path. SincegetBoundingClientRectisundefined(notnull) on test renderer refs, the!== nullcheck passes and the call crashes:This affects any jest test that renders a
BottomSheetcomponent deeply enough to trigger the hook.Fixes #2625
Reproduction: https://github.com/magrinj/bottom-sheet-test-bug