Skip to content

Comment on React Arborist – A full-featured tree component for React

Comments

Good efforts! Here's some quick feedback:

My first thought - how React Arborist is different from Ant Tree? https://ant.design/components/tree/

React Arborist dependencies looks sane https://github.com/brimdata/react-arborist/blob/main/package...

"memoize-one": "^6.0.0", "react-dnd": "^14.0.3", "react-dnd-html5-backend": "^14.0.1", "react-window": "^1.8.6"

However I was never a fan of react-dnd. Extremely hard to reason about react-dnd-html5-backend and spagetti code once you face edge scenarios.

Hard coded css means I need to fork the library

https://github.com/brimdata/react-arborist/blob/main/package...

  const style: CSSProperties = {
    position: "absolute",
    pointerEvents: "none",
    top: top - 2 + "px",
    left: treeView.indent + left + "px",
    right: treeView.indent + "px",
  };

Ant tree looks like a great tree library and is certainly more mature than react-arborist. However, react-arborist supports renaming a node, has a slightly different drag and drop feel, and leaves all styling up to the user. Not just the title, icon, and expand buttons.

I agree that the hard-coded DefaultCursor styles need to be configurable. I'll soon update. You'll be able to pass in your own component to render the DropCursor (blue line indicating the new position of the node you're dragging).

Been using AntTree with great success for a complex query builder. Highly recommend.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.