@redocly/theme 0.54.0 → 0.54.1

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.
@@ -36,7 +36,10 @@ var TabsSize;
36
36
  })(TabsSize || (exports.TabsSize = TabsSize = {}));
37
37
  function Tabs({ children, className, size }) {
38
38
  var _a, _b;
39
- const childrenArray = react_1.default.Children.toArray(children);
39
+ const [childrenArray, setChildrenArray] = (0, react_1.useState)(react_1.default.Children.toArray(children));
40
+ (0, react_1.useEffect)(() => {
41
+ setChildrenArray(react_1.default.Children.toArray(children));
42
+ }, [children]);
40
43
  const tabsContainerRef = (0, react_1.useRef)(null);
41
44
  const [isAnimating, setIsAnimating] = (0, react_1.useState)(false);
42
45
  const initialTab = (_b = (_a = childrenArray[0]) === null || _a === void 0 ? void 0 : _a.props.label) !== null && _b !== void 0 ? _b : '';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/theme",
3
- "version": "0.54.0",
3
+ "version": "0.54.1",
4
4
  "description": "Shared UI components lib",
5
5
  "keywords": [
6
6
  "theme",
@@ -88,8 +88,8 @@
88
88
  "nprogress": "0.2.0",
89
89
  "react-calendar": "5.1.0",
90
90
  "react-date-picker": "11.0.0",
91
- "@redocly/realm-asyncapi-sdk": "0.0.1",
92
- "@redocly/config": "0.26.0"
91
+ "@redocly/config": "0.26.0",
92
+ "@redocly/realm-asyncapi-sdk": "0.0.1"
93
93
  },
94
94
  "scripts": {
95
95
  "watch": "tsc -p tsconfig.build.json && (concurrently \"tsc -w -p tsconfig.build.json\" \"tsc-alias -w -p tsconfig.build.json\")",
@@ -25,7 +25,13 @@ type TabsProps = {
25
25
  };
26
26
 
27
27
  export function Tabs({ children, className, size }: TabsProps): JSX.Element {
28
- const childrenArray = React.Children.toArray(children) as React.ReactElement<TabItemProps>[];
28
+ const [childrenArray, setChildrenArray] = useState<React.ReactElement<TabItemProps>[]>(
29
+ React.Children.toArray(children) as React.ReactElement<TabItemProps>[],
30
+ );
31
+
32
+ useEffect(() => {
33
+ setChildrenArray(React.Children.toArray(children) as React.ReactElement<TabItemProps>[]);
34
+ }, [children]);
29
35
  const tabsContainerRef = useRef<HTMLUListElement>(null);
30
36
  const [isAnimating, setIsAnimating] = useState<boolean>(false);
31
37