Skip to content

Commit bc1a31f

Browse files
w3dimeta-codesync[bot]
authored andcommitted
- 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: #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
1 parent 535b844 commit bc1a31f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/react-native/Libraries/ReactNative/renderApplication.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export default function renderApplication<Props extends {...}>({
4747
displayMode,
4848
useOffscreen,
4949
}: RenderApplicationOptions<Props>) {
50-
invariant(rootTag, 'Expect to have a valid rootTag, instead got ', rootTag);
50+
invariant(rootTag, 'Expect to have a valid rootTag, instead got %s', rootTag);
5151

5252
let renderable: React.MixedElement = (
5353
<AppContainer

0 commit comments

Comments
 (0)