@bitrise/bitkit 13.239.0 → 13.241.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bitrise/bitkit",
3
3
  "description": "Bitrise React component library",
4
- "version": "13.239.0",
4
+ "version": "13.241.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+ssh://git@github.com/bitrise-io/bitkit.git"
@@ -1,4 +1,4 @@
1
- import React, { Children } from 'react';
1
+ import { Children } from 'react';
2
2
  import {
3
3
  Breadcrumb as ChakraBreadcrumb,
4
4
  BreadcrumbItem,
@@ -22,12 +22,9 @@ const Breadcrumb = forwardRef<BreadcrumbProps, 'nav'>((props, ref) => {
22
22
  const { children, hasSeparatorAfterLast, hasSeparatorBeforeFirst, separatorIconName, ...rest } = props;
23
23
  const { isMobile } = useResponsive();
24
24
 
25
- const childrenCount = Children.count(children);
26
- const items = Children.map(children, (child, index) => {
27
- if (!React.isValidElement(child)) {
28
- return null;
29
- }
30
-
25
+ const childArray = Children.toArray(children);
26
+ const childrenCount = childArray.length;
27
+ const items = childArray.map((child, index) => {
31
28
  return (
32
29
  <BreadcrumbItem>
33
30
  {hasSeparatorBeforeFirst && index === 0 && <BreadcrumbSeparator marginLeft="0" />}
@@ -213,7 +213,7 @@ function useDropdown<T>({
213
213
  // clear map when value is changed from the outside
214
214
  useEffect(() => {
215
215
  if (labelMapRef.current && Array.isArray(value)) {
216
- const removed = labelMapRef.current.keys().filter((key) => !value.includes(key));
216
+ const removed = [...labelMapRef.current.keys()].filter((key) => !value.includes(key));
217
217
  removed.forEach((remove) => labelMapRef.current?.delete(remove));
218
218
  }
219
219
  }, [value]);