Hi there,
I’m seeing an issue where changes to Phoenix functional components aren’t being reflected automatically until a refresh, or if I change other content on the page that is using the component.
For instance, I have a simple container:
defmodule Card do
use Phoenix.Component
def card(assigns) do
~H"""
<div>
<%= render_slot(@inner_block) %>
</div>
"""
end
end
This renders as expected on a page like so:
<Card.card>
<div>Test Content</div>
</Card.card>
When I modify the functional component, e.g. to add a class to add the styling for the card, the page seems to refresh but the Card component is not updated to reflect the new style. However, if I modify the “inner block” content, e.g. the “Test Content” text, then the page is refreshed and the component changes come through.
Is this expected behaviour, or am I doing something wrong? (Note that this is not on a LiveView page, just a simple view)
Thanks