Compose component inside xml is not redrawn when fragments are being replaced
I have added a compose component in a custom view XML which is added from a fragment, where the project is using a navigation graph library. But when I navigate from this fragment and come back the UI(XML) will be restored except the composed component inside it. It looks like the entire UI is getting redrawn without the collapse component when the fragments are being replaced.
compose component inside xml
...
...
and setting up here...