Closed paulfedory closed 1 year ago
Nevermind, I wasn't re-rendering the tree properly! (needed to change the key
after updating the data)
Hey @paulfedory
I have the same issue. Can you please share the part of the code where u use your CustomDataProvider?
And what do you mean needed to change the key after updating the data
?
Nevermind, I wasn't re-rendering the tree properly! (needed to change the
key
after updating the data)
@paulfedory what do you mean by updating the key? I have a custom data provider and an UncontrolledTreeEnvironment, but setting a UncontrolledTreeEnvironment key to e.g. Math.Random().toString() doesn't seem to cause it to display my new tree items.
Hello, I'm having some difficulty adding a new node to a tree. I'm using an uncontrolled environment, and a custom data provider, based on the example laid out here.
I've added a new function to my custom data provider called
resetData
which, like the constructor, takes initems
and sets the data property. I'm calling this function at the right time and with logging, I can see that the correct data is being set. The tree does not update after calling this new function.Is this how I'm supposed to be changing the data for a tree? Should I be constructing a new data provider every time I need to pass in new data?
Below is the code for my data provider: