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)
- in the useDragHook hook, is it possible to somehow return not the id but the entire node? HOT 2
- need example for renderCursor or renderDragPreview HOT 4
- Using external dndManager causes the rows to constantly re-render during dragging HOT 1
- Inifinite Scrolling within Branches? HOT 2
- Item count increases randomly HOT 1
- Property 'select' does not exist on type 'never' HOT 1
- Hidden flag for nodes HOT 1
- Doesn't work on remix HOT 1
- React Aborist ScrollTo bug with deep nested nodes HOT 1
- [HELP] Multiple selection from array of ids
- Render 1 million root elements on different screen sizes
- Deselect not firing event HOT 2
- 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 3
- 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
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.