From 13900d75b8c8fcb2f9cac3a1cbf313870e52b221 Mon Sep 17 00:00:00 2001 From: Nicola Corti Date: Thu, 5 Dec 2024 09:54:47 -0800 Subject: [PATCH] Remove replaceAll from RNTester sample code (#48099) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/48099 This is currently breaking the Sample Module screen on RN-Tester. Let's remove it. Changelog: [Internal] [Changed] - Remove replaceAll from RNTester sample code Reviewed By: cipolleschi Differential Revision: D66764656 fbshipit-source-id: acd123374d23b37977d5506f70f29da7f5d6311f --- .../js/examples/TurboModule/SampleLegacyModuleExample.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/rn-tester/js/examples/TurboModule/SampleLegacyModuleExample.js b/packages/rn-tester/js/examples/TurboModule/SampleLegacyModuleExample.js index 322c4de00f8..7d389eaeda3 100644 --- a/packages/rn-tester/js/examples/TurboModule/SampleLegacyModuleExample.js +++ b/packages/rn-tester/js/examples/TurboModule/SampleLegacyModuleExample.js @@ -63,7 +63,8 @@ function stringify(obj: mixed): string { return value; } - return (JSON.stringify(obj, replacer) || '').replaceAll('"', "'"); + // Change this to don't use replaceAll + return (JSON.stringify(obj, replacer) || '').replace(/"/g, "'"); } class SampleLegacyModuleExample extends React.Component<{||}, State> {