frontend-collective/react-sortable-tree

Need Help with Custom Theme - How to access generatedNodeProps from within treeNodeRenderer?

CarelessCourage opened this issue · 1 comments

Im writing a custom theme for my work. Its working well so far. But I was wondering if theres a way to access the generatedNodeProps from the treeNodeRenderer. To be clear, I know how youre supposed to do it. The generatedNodeProps seem to be exposed to the components through deconstructing ...otherProps. But this only works in the node-content-renderer file not the tree-node-renderer. It seems that the generatedNodeProps does not actually get passed to the tree-node-renderer. From looking at the source code im pretty sure I could fix this myself by messing with the source files. But it would obviusly be preferable if there was a more streamlined solution.

In reality what I want to be able to do is to execute the insertNode Data Helper Function from within tree-node-renderer. But to be able to do that I need to be able to access the treedata from within the tree-node-rederer. It doesnt seem like treeData is passed there at all. And I cant pass it myself because generatedNodeProps also isnt passed.

In other words, my problem can be fixed in multiple ways. I need to be able to access either the treeData or the generatedNodeProps, or I need to be able to trigger a Data Helper Function outside of tree-node-renderer somehow, and just pass it some data.

This is the first time Im developing in react, coming mainly from a vue.js background so there might be some react solutions I might not even have thought about. I suspect however that there might not actually be a way to access any of this from inside the tree-node-renderer. In which case I might have to either get the desired feature working some other way(I have a few ideas) or I might just decide to fork the source code and implement the passing of the treeData object to tree-node-renderer myself.

Anyway. Thanks for any help. Sorry for the long post. Ill post some quick screenshots to let you guys get a quick glance at what im working with.

Screenshot (5)_LI
Screenshot (2)_LI
Screenshot (3)_LI
Screenshot (4)_LI

@CarelessCourage Did you manage to get this work ? Is this theme an open-source?