-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add customItemsRenderer prop #152
Conversation
packages/core/src/tree.js
Outdated
</Items> | ||
{customItemsRenderer ? ( | ||
React.cloneElement(customItemsRenderer, { | ||
...props, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure we should just pass the props (I'm talking about ...props), the props are meant for tree.
As any custom renderer, you can OTHER props externally when you do something like
<Tree customItemsRenderer=<MyRenderer someProp={} />
Unless you mean yo pass something like
<Tree customItemsRenderer={someRenderer}/>
In which case you also need to create the component in the tree and you can still pass props using something like
<Tree customItemsRenderer={() => <SomeRenderer .../>}/>
Hope my comment is understandable.
forwardIconRenderer={forwardIconRenderer} | ||
selectedItem={selectedItem} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't want to pass these two?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as I see selected Item we pass externally
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ForwardIconRenderer the same
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's important we maintain the same API.
IT would be very confusing if the icons work in one instance but if you pass a custom list they don't.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a ping on this so that we can merge
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
Don't forget to update the readmes |
Is it manually change? or we have specific tool for readme generation? |
Unfortunately manual at this point. |
We extends from BaseList in hierarchical_select

It's different way to drilling props
In the react-tree it's native div tag.
That's why was added customItemsRenderer
📦 Published PR as canary version:
Canary Versions
✨ Test out this PR locally via: