Skip to content

Commit

Permalink
Fix for cssinjs#1635
Browse files Browse the repository at this point in the history
  • Loading branch information
barandurakk committed Apr 12, 2023
1 parent 6d17e19 commit 3752dc3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/jss/src/RuleList.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,10 @@ export default class RuleList {
remove(rule) {
this.unregister(rule)
delete this.raw[rule.key]
this.index.splice(this.index.indexOf(rule), 1)
const index = this.index.findIndex(v => v.key === rule.key);
if (index > -1) {
this.index.splice(index, 1)
}
}

/**
Expand Down

0 comments on commit 3752dc3

Please sign in to comment.