Skip to content

Commit

Permalink
[0.74] [Fabric] Fixes a crash that happens on release builds (#13619)
Browse files Browse the repository at this point in the history
Backport of PR #13573 to 0.74.

* [Fabric] Fixes a crash that happens on release builds

* Change files

Co-authored-by: Andrew Coates <30809111+acoates-ms@users.noreply.github.com>
  • Loading branch information
jonthysell and acoates-ms authored Aug 27, 2024
1 parent 39e5e79 commit 8a4ac58
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "[0.74] [Fabric] Fixes a crash that happens on release builds",
"packageName": "react-native-windows",
"email": "30809111+acoates-ms@users.noreply.github.com",
"dependentChangeType": "patch"
}
3 changes: 2 additions & 1 deletion vnext/Microsoft.ReactNative/ReactHost/ReactInstanceWin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,8 @@ void ReactInstanceWin::InitializeBridgeless() noexcept {
facebook::react::ReactInstance::JSRuntimeFlags options;
m_bridgelessReactInstance->initializeRuntime(options, [=](facebook::jsi::Runtime &runtime) {
auto logger = [loggingHook = GetLoggingCallback()](const std::string &message, unsigned int logLevel) {
loggingHook(static_cast<facebook::react::RCTLogLevel>(logLevel), message.c_str());
if (loggingHook)
loggingHook(static_cast<facebook::react::RCTLogLevel>(logLevel), message.c_str());
};
facebook::react::bindNativeLogger(runtime, logger);

Expand Down

0 comments on commit 8a4ac58

Please # to comment.