Skip to content

Commit

Permalink
Update packages/react/src/ProgressBar/ProgressBar.tsx
Browse files Browse the repository at this point in the history
Co-authored-by: Josh Black <joshblack@github.com>
  • Loading branch information
TylerJDev and joshblack authored Oct 30, 2024
1 parent a2ca83b commit 8b67e67
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/react/src/ProgressBar/ProgressBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ export const ProgressBar = forwardRef<HTMLSpanElement, ProgressBarProps>(
throw new Error('You should pass `progress` or children, not both.')
}

// Get the number of non-empty nodes passed as children, this will exclude
// booleans, null, and undefined
const validChildren = React.Children.toArray(children).length

return (
Expand Down

0 comments on commit 8b67e67

Please sign in to comment.