Skip to content

Commit

Permalink
fix(react/theme): correct the check for empty cssVariables to avoid…
Browse files Browse the repository at this point in the history
… logical errors (#953)

* fix(react/theme): correct the check for empty `cssVariables` to avoid logical errors

* Create tonic-ui-943c.md
  • Loading branch information
cheton authored Dec 5, 2024
1 parent edc8823 commit 621d25b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/tonic-ui-943c.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@tonic-ui/react": patch
---

fix(react/theme): fixed a logical error in the `CSSVariables` component by correcting the condition to check for empty `cssVariables`
2 changes: 1 addition & 1 deletion packages/react/src/theme/CSSVariables.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const CSSVariables = () => {
const styles = useCallback((theme) => {
const rootSelector = theme?.rootSelector;
const cssVariables = ensurePlainObject(theme?.cssVariables);
if (!rootSelector || Object.keys(cssVariables) === 0) {
if (!rootSelector || Object.keys(cssVariables).length === 0) {
return {};
}
return {
Expand Down

0 comments on commit 621d25b

Please sign in to comment.