@@ -159,6 +159,7 @@ inline static jsi::Value objectFromUnistyle(jsi::Runtime& rt, std::shared_ptr<Hy
159159 auto & registry = UnistylesRegistry::get ();
160160 auto unistyle = registry.getUnistyleById (unistyleID);
161161 auto scopedTheme = registry.getScopedTheme ();
162+ parser::Parser parser (unistylesRuntime);
162163
163164 // scoped theme path — parse with scope so `withUnistyles`-wrapped
164165 // components inside <ScopedTheme> reflect the scope instead of the global theme
@@ -168,7 +169,6 @@ inline static jsi::Value objectFromUnistyle(jsi::Runtime& rt, std::shared_ptr<Hy
168169 : std::vector<folly::dynamic>{};
169170
170171 auto unistyleData = std::make_shared<UnistyleData>(unistyle, variants, scopedArguments, scopedTheme);
171- auto parser = parser::Parser (unistylesRuntime);
172172 auto parsedStyleSheet = parser.getParsedStyleSheetForScopedTheme (rt, unistyle, scopedTheme.value ());
173173
174174 if (!parsedStyleSheet.isUndefined ()) {
@@ -180,7 +180,7 @@ inline static jsi::Value objectFromUnistyle(jsi::Runtime& rt, std::shared_ptr<Hy
180180 }
181181 }
182182
183- parser::Parser (unistylesRuntime) .rebuildUnistyle (rt, unistyle, variants, parsedArguments);
183+ parser.rebuildUnistyle (rt, unistyle, variants, parsedArguments);
184184
185185 return jsi::Value (rt, unistyle->parsedStyle .value ()).asObject (rt);
186186 });
0 commit comments