Comments (2)
Ok, gotcha. Yeah, I thought more about it and it seems like it's basically a variation of the render prop pattern. I didn't recognize that with the Node
pulled into a external variable, rather than provided inline as a closure. Thanks for responding!
from react-arborist.
Hi @acjay, thanks for writing up this suggestion. I know what you mean. It does seem a little strange. I based that API on the react-window library, which is used by react-arborist. Brian passes in the row renderer as a single child component.
Over time, it grew on me. It mirrors the hierarchy between the parent Tree component and the children Node components.
Since React's children are just a special-case prop, I suppose you could make this argument for any component that accepts children.
Why do we write...
<Parent>
<Child />
</Parent>
instead of...
<Parent children={<Child />} />
I admit the way we use the "children" prop in the Tree is different than above, but it's at least a bit similar.
In the end I think this is just a "chocolate" or "vanilla" type decision, so I plan to leave the API as is.
However, I thank you for your time and for prompting me to think about this more.
from react-arborist.
Related Issues (20)
- How to drag a node INTO a leaf node
- Better scrolling while user is dragging
- [Question] How to build a tree with some folders open and some closed? HOT 1
- There is a bug in using the tree.update method to set height.
- Duplicate HTML5 backend error HOT 5
- Deletion behavior can be unintuitive HOT 4
- Lack of control over delete leads to some weird scenarios HOT 2
- Should we be able to focus the entire tree? HOT 2
- Using react-arborist in an app seems to break file & folder drop on <input type="file" multiple /> elements HOT 2
- How rename `name` to `node_name` and create node with name
- Drag and Drop should be handled within the level hierarchy
- How do you implement controlled select?
- Refresh the tree HOT 1
- Node selection getting false when we click outside (treeview) HOT 2
- Limit the depth of the tree to just N-levels HOT 1
- onMove receives inconsistent parentId and index
- Multi select is stopping event propogation HOT 2
- Why does moving the mouse over the context menu modal trigger a re-render?
- ContextMenu Rename and Delete HOT 1
- Split first level horizontally
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-arborist.