I have a stateful live component. Besides the id, it receives another parameter, “products”, from the parent live view.
The parent live view constains a pubsub subscription and an handle_info that changes the products parameter.
Always when products is changed, the live component is re-rendered (as expected), and re-mounted which is not as expected.
The documentation says, a.o. “In stateful components, mount/1
is called only once, when the component is first rendered. For each rendering, the optional preload/1
and update/2
callbacks are called before render/1
.”
So, I would expect that update is called with the new products, parameter. But it appears that also mount is called. What am I missing?