How to update componentProps and have overlay components rerender?


Many ionic components (modal, loading, popover etc) are based on the overlay. According to the doc, one way to pass in data is via the ComponentProps property. This only works for the first time, but if I update ComponentProps, the overlay component will not update and there is no way for me to force update.

Take popover for example, once present method has been called, it seems the HTML element has been created with the initial value of ComponentProps. My question is if I update ComponentProps, how do I get popover to reflect my latest value in ComponentProps?

Btw, I am using Ionic Angular, I only see ngOnInit lifecycle event called in popover component, I don’t see ngOnChanges event fired at all.


I’ve encountered this as well. It is really counterintuitive that the overlay components do not fire ngOnChanges on inputs that are supplied via ComponentProps.
Shouldn’t Ionic call change detector in the background when it creates the component?

FYI, you can pass Observables through componentProps to work around this.