Skip to content

Commit

Permalink
fix: small optimization to add extra gaurd to updatePropDefaults (#482)
Browse files Browse the repository at this point in the history
* fix: small optimization to add extra gaurd to updatePropDefaults

* fix: update formatting
  • Loading branch information
joshhowenstine authored Mar 6, 2024
1 parent 4a9c28a commit 589b9e1
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,15 @@ export default function withThemeStyles(Base, mixinStyle = {}) {
*/
_updatePropDefaults() {
// If the current properties are the same as the previous configuration, no update is needed

if (
!Object.keys(this._styleManager.props).length ||
JSON.stringify(this._styleManager.props) ===
JSON.stringify(this._prevComponentConfigProps)
JSON.stringify(this._prevComponentConfigProps)
) {
return;
}

// Compare current properties with previous configuration and get the payload
const payload = this._prevComponentConfigProps
? mergeObjectsWithSecondDominant(
Expand Down

0 comments on commit 589b9e1

Please sign in to comment.