Tree["nodeRenderer"]
has hidden requirement to forward ref to underlying TreeNode
#2357
Closed
1 task done
Labels
bug
Something isn't working
Describe the bug (current behavior)
If
Tree["nodeRenderer"]
renders some component that wrapsTreeNode
there is an error logged in a console:Warning: Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()
.Also in virtualized
small
Tree
spacing between nodes are off.There is no mention that component rendered in
Tree["nodeRenderer"]
shouldforwardRef
to the wrappedTreeNode
component.Expected Behavior
It should be documented that
ref
will be passed to the component rendered byTree["nodeRenderer"]
and if wrapper component is rendered it should forwarf ref toTreeNode
.Link to minimal repro
https://stackblitz.com/edit/github-c2ek3e?file=src%2FApp.tsx
Steps To Reproduce
TreeNodeRenderer
withFixedTreeNodeRenderer
on line 114 resolves these issuesPackage Version
Anything else?
No response
The text was updated successfully, but these errors were encountered: