-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Labels
enhancementNew feature or requestNew feature or request
Description
This parameter defines whether children can or cannot be passed into the item. If false, this element also removes all current children. If you want to disallow only additional children but keep the current (keep them visible), use allowDropInside: false instead.
import React, { useState } from "react";
import { ReactTreeList, ReactTreeListProps } from '@bartaxyz/react-tree-list';
const Component: React.FC = () => {
const [data, setData] = useState<ReactTreeListProps["data"]>([
{
label: "none",
// This parameter will hide all children (not remove them from the object though)
allowChildren: true,
// Nodes inside "children" won't be displayed
children: [
{ label: "Heyo", },
],
},
]);
return (
<ReactTreeList
data={data}
onChange={setData}
/>
);
};Default: true
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request