Use lazy TurboModule lookup for Clipboard in LogBoxInspector (#56199)#56199
Closed
seantarzy wants to merge 1 commit intofacebook:mainfrom
Closed
Use lazy TurboModule lookup for Clipboard in LogBoxInspector (#56199)#56199seantarzy wants to merge 1 commit intofacebook:mainfrom
seantarzy wants to merge 1 commit intofacebook:mainfrom
Conversation
|
@seantarzy has exported this pull request. If you are a Meta employee, you can view the originating Diff in D97008263. |
10fc81f to
1b638dc
Compare
seantarzy
added a commit
to seantarzy/react-native
that referenced
this pull request
Mar 23, 2026
…k#56199) Summary: D95277489 added a Copy button to LogBoxInspector that imports `Clipboard`, which calls `TurboModuleRegistry.getEnforcing('Clipboard')` at module load time. In environments where the native Clipboard module is not available (e.g., Fantom integration tests), this throws and crashes the entire test file (`LogBox-itest.fb.js`). Replace the static `Clipboard` import with a lazy `TurboModuleRegistry.get()` call at invocation time, which returns `null` when the module is unavailable instead of throwing. Changelog: [Fixed][LogBox] - Fix crash when Clipboard module is unavailable Reviewed By: NickGerleman Differential Revision: D97008263
1b638dc to
8f1bb59
Compare
seantarzy
added a commit
to seantarzy/react-native
that referenced
this pull request
Mar 23, 2026
…k#56199) Summary: D95277489 added a Copy button to LogBoxInspector that imports `Clipboard`, which calls `TurboModuleRegistry.getEnforcing('Clipboard')` at module load time. In environments where the native Clipboard module is not available (e.g., Fantom integration tests), this throws and crashes the entire test file (`LogBox-itest.fb.js`). Replace the static `Clipboard` import with a lazy `TurboModuleRegistry.get()` call at invocation time, which returns `null` when the module is unavailable instead of throwing. Changelog: [Fixed][LogBox] - Fix crash when Clipboard module is unavailable Reviewed By: NickGerleman Differential Revision: D97008263
8f1bb59 to
06ac503
Compare
seantarzy
added a commit
to seantarzy/react-native
that referenced
this pull request
Mar 23, 2026
…k#56199) Summary: Pull Request resolved: facebook#56199 D95277489 added a Copy button to LogBoxInspector that imports `Clipboard`, which calls `TurboModuleRegistry.getEnforcing('Clipboard')` at module load time. In environments where the native Clipboard module is not available (e.g., Fantom integration tests), this throws and crashes the entire test file (`LogBox-itest.fb.js`). Replace the static `Clipboard` import with a lazy `TurboModuleRegistry.get()` call at invocation time, which returns `null` when the module is unavailable instead of throwing. Changelog: [Fixed][LogBox] - Fix crash when Clipboard module is unavailable Reviewed By: NickGerleman Differential Revision: D97008263
06ac503 to
928fa57
Compare
seantarzy
added a commit
to seantarzy/react-native
that referenced
this pull request
Mar 23, 2026
…k#56199) Summary: D95277489 added a Copy button to LogBoxInspector that imports `Clipboard`, which calls `TurboModuleRegistry.getEnforcing('Clipboard')` at module load time. In environments where the native Clipboard module is not available (e.g., Fantom integration tests), this throws and crashes the entire test file (`LogBox-itest.fb.js`). Replace the static `Clipboard` import with a lazy `TurboModuleRegistry.get()` call at invocation time, which returns `null` when the module is unavailable instead of throwing. Changelog: [Fixed][LogBox] - Fix crash when Clipboard module is unavailable Reviewed By: NickGerleman Differential Revision: D97008263
928fa57 to
61a8634
Compare
…k#56199) Summary: Pull Request resolved: facebook#56199 D95277489 added a Copy button to LogBoxInspector that imports `Clipboard`, which calls `TurboModuleRegistry.getEnforcing('Clipboard')` at module load time. In environments where the native Clipboard module is not available (e.g., Fantom integration tests), this throws and crashes the entire test file (`LogBox-itest.fb.js`). Replace the static `Clipboard` import with a lazy `TurboModuleRegistry.get()` call at invocation time, which returns `null` when the module is unavailable instead of throwing. Changelog: [Fixed][LogBox] - Fix crash when Clipboard module is unavailable Reviewed By: NickGerleman Differential Revision: D97008263
61a8634 to
94e8ea9
Compare
|
This pull request has been merged in a06153c. |
Collaborator
|
This pull request was successfully merged by @seantarzy in a06153c When will my fix make it into a release? | How to file a pick request? |
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.
Summary:
D95277489 added a Copy button to LogBoxInspector that imports
Clipboard, which callsTurboModuleRegistry.getEnforcing('Clipboard')at module load time. In environments where the native Clipboard module
is not available (e.g., Fantom integration tests), this throws and
crashes the entire test file (
LogBox-itest.fb.js).Replace the static
Clipboardimport with a lazyTurboModuleRegistry.get()call at invocation time, which returnsnullwhen the module is unavailable instead of throwing.Changelog: [Fixed][LogBox] - Fix crash when Clipboard module is unavailable
Reviewed By: NickGerleman
Differential Revision: D97008263