Skip to content

Commit 3a14a0a

Browse files
authored
perf(core): no need for batchUpdated if no selector (NativeScript#9121)
1 parent 28061e3 commit 3a14a0a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/core/ui/styling/style-scope.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,9 @@ export class CssState {
472472
}
473473

474474
const matchingSelectors = this._match.selectors.filter((sel) => (sel.dynamic ? sel.match(view) : true));
475+
if (!matchingSelectors || matchingSelectors.length === 0) {
476+
return;
477+
}
475478
view._batchUpdate(() => {
476479
this.stopKeyframeAnimations();
477480
this.setPropertyValues(matchingSelectors);

0 commit comments

Comments
 (0)