From 38e1e0de53d6a33f40eda24f6cbaf64ebad3aaa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Norte?= Date: Thu, 14 Aug 2025 06:19:00 -0700 Subject: [PATCH] Use string references in Fantom native module (#53274) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53274 Changelog: [internal] Minor refactor Reviewed By: rshest Differential Revision: D80255982 fbshipit-source-id: 703f32a1edf5c225b0b07b3c519932ebe167b2c8 --- private/react-native-fantom/tester/src/NativeFantom.cpp | 4 ++-- private/react-native-fantom/tester/src/NativeFantom.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/private/react-native-fantom/tester/src/NativeFantom.cpp b/private/react-native-fantom/tester/src/NativeFantom.cpp index 6cf7afe7da9..5b677922876 100644 --- a/private/react-native-fantom/tester/src/NativeFantom.cpp +++ b/private/react-native-fantom/tester/src/NativeFantom.cpp @@ -118,7 +118,7 @@ jsi::Object NativeFantom::getFabricUpdateProps( void NativeFantom::enqueueNativeEvent( jsi::Runtime& /*runtime*/, std::shared_ptr shadowNode, - std::string type, + const std::string& type, const std::optional& payload, std::optional category, std::optional isUnique) { @@ -285,7 +285,7 @@ void NativeFantom::startJSSamplingProfiler(jsi::Runtime& /*runtime*/) { void NativeFantom::stopJSSamplingProfilerAndSaveToFile( jsi::Runtime& runtime, - std::string filePath) { + const std::string& filePath) { auto* hermesRootAPI = jsi::castInterface(hermes::makeHermesRootAPI()); hermesRootAPI->disableSamplingProfiler(); diff --git a/private/react-native-fantom/tester/src/NativeFantom.h b/private/react-native-fantom/tester/src/NativeFantom.h index 02ff33a31b0..5870a89751a 100644 --- a/private/react-native-fantom/tester/src/NativeFantom.h +++ b/private/react-native-fantom/tester/src/NativeFantom.h @@ -114,7 +114,7 @@ class NativeFantom : public NativeFantomCxxSpec { void enqueueNativeEvent( jsi::Runtime& runtime, std::shared_ptr shadowNode, - std::string type, + const std::string& type, const std::optional& payload, std::optional category, std::optional isUnique); @@ -158,7 +158,7 @@ class NativeFantom : public NativeFantomCxxSpec { void stopJSSamplingProfilerAndSaveToFile( jsi::Runtime& runtime, - std::string filePath); + const std::string& filePath); void setImageResponse( jsi::Runtime& rt,