Skip to content

Commit

Permalink
fix: typeerror when clsx str is undefined (#967)
Browse files Browse the repository at this point in the history
* fix: typeerror when clsx str is undefined

* docs: add changeset

---------

Co-authored-by: Segun Adebayo <[email protected]>
  • Loading branch information
sholzmayer and segunadebayo authored Oct 28, 2023
1 parent 35771b9 commit 152b0a7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/wet-plants-flash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@zag-js/core": patch
---

Fix issue where mergeProps throws when className str is undefined
2 changes: 1 addition & 1 deletion packages/core/src/merge-props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ interface Props {

const clsx = (...args: (string | undefined)[]) =>
args
.map((str) => str?.trim())
.map((str) => str?.trim?.())
.filter(Boolean)
.join(" ")

Expand Down

4 comments on commit 152b0a7

@vercel
Copy link

@vercel vercel bot commented on 152b0a7 Oct 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

zag-vue – ./examples/vue-ts

zag-vue-git-main-chakra-ui.vercel.app
zag-vue-chakra-ui.vercel.app
zag-vue.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 152b0a7 Oct 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

zag-solid – ./examples/solid-ts

zag-solid-chakra-ui.vercel.app
zag-solid.vercel.app
zag-solid-git-main-chakra-ui.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 152b0a7 Oct 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

zag-nextjs – ./examples/next-ts

zag-two.vercel.app
zag-nextjs-chakra-ui.vercel.app
zag-nextjs-git-main-chakra-ui.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 152b0a7 Oct 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.