Getting a page re-render even when using push_navigate and .link within same `live_session`

This has been doing my head in but I’m seeing a full re-render of my pages when using .link and push_navigate within the same live_session.

This navigation is definitely between pages in the same live_session and the only on_mount is the UserAuth generated by the mix phx.gen.auth.

I’ve also confirmed that the only layouts being applied is the put_root_layout as part of the browser and the layout declared as part of the :live_view.

The only thing that looks out of the ordinary is this line in the console when I navigate between the two routes.

destroyed: the child has been removed from the parent

I don’t understand what I could possibly be missing at this point!

  • Phoenix Versions
      {:phoenix, "~> 1.7.21"},
      {:phoenix_ecto, "~> 4.5"},
      {:phoenix_html, "~> 4.1"},
      {:phoenix_live_reload, "~> 1.2", only: :dev},
      {:phoenix_live_view, "~> 1.0"},

That’s a normal notice - how do you know you’re getting a full re-render?

2 Likes

My apologies, so in the end I think that having “Disable Cache” set in my Developer Tools was causing a behaviour where the entire DOM looked to be visually getting re-rendered (elements moving around etc) but this was just the images being reloaded.

My concern was the DOM diffing might have been acting up but I guess that I had just been looking at this too long.

Thanks for the response though!