Skip to content

Commit 6520db2

Browse files
cipolleschifacebook-github-bot
authored andcommitted
Fix RNTester running in the old architecture (facebook#50940)
Summary: We landed a PR that was importing a file available only in the New Architecture also when the app was running in the old architecture. This was creating a corrupted bundle for rntester. This PR fixes the issue bypass-github-export-checks ## Changelog: [Internal] - Fix RNTester on Android Pull Request resolved: facebook#50940 Test Plan: Tested locally by setting `newArchEnabled` to false in the gradle.properties file Reviewed By: javache, cortinico Differential Revision: D73663049 Pulled By: cipolleschi fbshipit-source-id: c8d6e4190adee7388e51901360a811b0007ee3a5
1 parent 2489308 commit 6520db2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/rn-tester/js/examples/ContentURLAndroid/ContentURLAndroid.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import {
2222
TouchableOpacity,
2323
View,
2424
} from 'react-native';
25-
import NativeSampleTurboModule from 'react-native/Libraries/TurboModule/samples/NativeSampleTurboModule';
2625

2726
function blobToBase64(blob: Blob) {
2827
return new Promise<string>((resolve, reject) => {
@@ -43,6 +42,8 @@ const ContentSelector = (): React.Node => {
4342
const [base64Image, setBase64Image] = React.useState('');
4443
const imageSelector = React.useCallback(async () => {
4544
try {
45+
const NativeSampleTurboModule =
46+
require('react-native/Libraries/TurboModule/samples/NativeSampleTurboModule').default;
4647
const uri = await NativeSampleTurboModule.getImageUrl?.();
4748
if (uri != null) {
4849
console.log({uri});

0 commit comments

Comments
 (0)