[Bug][PanelBar] Passing no children to the PanelBar leads to an error
vveesseelliinnaa opened this issue · 1 comments
vveesseelliinnaa commented
Public item: https://feedback.telerik.com/kendo-react-ui/1661558
I'm submitting a...
- Regression report
Current behavior
There is a bug when rendering nested PanelBarItem
components into a PanelBar
. This error began in version 8.0 and still exists in 8.3.0.
Minimal reproduction of the problem with instructions
- Go to https://codesandbox.io/p/sandbox/adoring-zhukovsky-c5mwgy
- Observe the thrown error
Possible workaround
Using "null" as the initial value and add the array once you have the nested PanelBarItems:
const [items1, setItems1] = React.useState(null);
React.useEffect(() => {
setTimeout(() => {
setItems1([<PanelBarItem title="Test" />]);
}, 1500);
}, []);
return (
<div className="panelbar-wrapper">
<PanelBar>
<PanelBarItem title={"Projects"}>{items1}</PanelBarItem>
</PanelBar>
</div>
);
};
silviyaboteva commented
The fix is included in version 8.4.0-develop.5
.