Skip to content

Commit f278c71

Browse files
committed
chore: code review
1 parent 6e0e8c1 commit f278c71

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

packages/unistyles/cxx/core/UnistyleWrapper.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)