I'm looking for any ideas on how to store Component states in a way that can be easily reapplied. Imagine you want to keep the current state of your Buttons and such (e.g. label, disabled, etc) so that after changing some other aspects, you can restore the View to that previous point.
My original thought was to simply copy() the .children list, but the members are then passed by reference.
You cannot deepcopy the .children, either. There are aspects of the class that cannot be pickled.
I spent some time diving into any existing library code, and came up with a weird issue.
ui.View's .to_components() method returns a dict, which doesn't seem to be useful anywhere, because the internal function _component_to_item, which takes component data to convert to the respective Item, expects a class instance.
I can't seem to find any existing functionality to do this, and sorta stuck on any possible way of accomplishing this. Hoping someone has either already solved this or can see something I haven't been able to.