From bc1a31fb16f0cf1ca92331499c6f2fa4e347dfbf Mon Sep 17 00:00:00 2001 From: W3D Date: Mon, 11 May 2026 08:14:14 -0700 Subject: [PATCH] - Fix missing format specifier in renderApplication invariant (#56329) Summary: The `invariant` call in `renderApplication` passes `rootTag` as a substitution argument, but the format string has no `%s` placeholder. When the invariant fails, the error message reads: ``` Expect to have a valid rootTag, instead got ``` instead of: ``` Expect to have a valid rootTag, instead got null ``` The value is silently dropped, making the error less useful for debugging. ## Changelog: [General] [Fixed] - Fix missing format specifier in renderApplication invariant Pull Request resolved: https://github.com/facebook/react-native/pull/56329 Test Plan: - Verified with `invariant` directly: without `%s` the third argument is ignored, with `%s` it is substituted into the message. - Prettier and ESLint checks pass. Reviewed By: cipolleschi Differential Revision: D104657367 Pulled By: javache fbshipit-source-id: 6b0fad2371941207ef064fa7ea63cdf9aa61ae7f --- .../react-native/Libraries/ReactNative/renderApplication.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native/Libraries/ReactNative/renderApplication.js b/packages/react-native/Libraries/ReactNative/renderApplication.js index c7b403936cd..6b92a8d4403 100644 --- a/packages/react-native/Libraries/ReactNative/renderApplication.js +++ b/packages/react-native/Libraries/ReactNative/renderApplication.js @@ -47,7 +47,7 @@ export default function renderApplication({ displayMode, useOffscreen, }: RenderApplicationOptions) { - invariant(rootTag, 'Expect to have a valid rootTag, instead got ', rootTag); + invariant(rootTag, 'Expect to have a valid rootTag, instead got %s', rootTag); let renderable: React.MixedElement = (