telerik/kendo-react

[Bug][PanelBar] Passing no children to the PanelBar leads to an error

vveesseelliinnaa opened this issue · 1 comments

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.

image

Minimal reproduction of the problem with instructions

  1. Go to https://codesandbox.io/p/sandbox/adoring-zhukovsky-c5mwgy
  2. 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>
  );
};

The fix is included in version 8.4.0-develop.5.