How to use the @mui-treasury/utils/useStateBinding function in @mui-treasury/utils

To help you get started, we’ve selected a few @mui-treasury/utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github siriwatknp / mui-treasury / packages / mui-components / src / menuList / collapsible / CollapsibleMenuList.js View on Github external
const CollapsibleMenuList = ({
  initialExpanded,
  subMenus,
  renderWrapper,
  getParentProps,
  renderParent,
  getChildProps,
  renderChild,
  collapseProps,
  listClassName,
  listProps,
}) => {
  const [expanded, setExpanded] = useStateBinding(initialExpanded, false);
  const elements = (
    <>
      {renderParent({
        ...getParentProps({ expanded }),
        expanded,
        onToggle: () => setExpanded(!expanded),
      })}
      
        
          {subMenus.map((data, idx, array) =>
            renderChild(
              getChildProps({ data, expanded, idx, array }),
              idx,
              array
            )
          )}