### Simple React Tree Example Source: https://headless-tree.lukasbach.com Demonstrates basic integration of the Headless Tree component in React. It initializes the tree with an expanded item and defines data loading and item display logic. Use this for a straightforward tree implementation. ```javascript export const SimpleExample = () => { const tree = useTree({ initialState: { expandedItems: ["folder-1"] }, rootItemId: "folder", getItemName: (item) => item.getItemData(), isItemFolder: (item) => !item.getItemData().endsWith("item"), dataLoader: { getItem: (itemId) => itemId, getChildren: (itemId) => [ `${itemId}-1`, `${itemId}-2`, `${itemId}-3`, `${itemId}-1item`, `${itemId}-2item`, ], }, indent: 20, features: [syncDataLoaderFeature, selectionFeature, hotkeysCoreFeature], }); return (
{tree.getItems().map((item) => ( ))}
); }; ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.