Refresh Treeview item created with CreateItemComponent

Hi there,

I have a question about refreshing a TreeviewItem.
I am using TreeViewItem::createItemComponent() to create a custom component which consists of an editable label. There is a variable which changes that sets the colour of the label. I need the functionality to be able to send a call to either refresh or repaint the custom component when this variable changes.

Currently the only way I can get it to update is by clicking the treeview item, which then re draws the entire tree and therefore sets the correct colour when calling createItemComponent(). What is the best way to handle refreshing the item? I was hoping treeHasChanged() would work but i’ve had no luck.