How to use the @bentley/presentation-components.usePresentationNodeLoader function in @bentley/presentation-components

To help you get started, we’ve selected a few @bentley/presentation-components 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 imodeljs / imodeljs / test-apps / ui-test-app / src / frontend / appui / widgets / NavigationTreeWidget.tsx View on Github external
const NavigationTree: React.FC = (props: NavigationTreeProps) => {
  const nodeLoader = usePresentationNodeLoader({
    imodel: props.iModelConnection,
    rulesetId: props.rulesetId,
    pageSize: 20,
  });
  const modelSource = useModelSource(nodeLoader)!;
  const eventHandler = React.useMemo(() => new TreeEventHandler({ modelSource, nodeLoader, collapsedChildrenDisposalEnabled: true }), [modelSource, nodeLoader]);
  const unifiedSelectionEventHandler = useControlledTreeUnifiedSelection(modelSource, eventHandler, nodeLoader.getDataProvider());
  const visibleNodes = useVisibleTreeNodes(modelSource);

  return (