From a459196cd81428cba552899f70ea894bd2dca524 Mon Sep 17 00:00:00 2001 From: Jeff Cole Date: Fri, 8 Apr 2022 08:38:05 -0400 Subject: [PATCH] Use `live_redirect/2` instead of internal data attributes The implementation of `LiveHelpers.link/1` for the `:navigate` case was using data attributes (`data-phx-link` and `data-phx-link-state`) that are internal to the implementation of LiveView's live navigation. This change refactors `link/1` to use the public `LiveView.Helpers.live_redirect/2` to achieve the same behavior. --- lib/live_beats_web/live/live_helpers.ex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/live_beats_web/live/live_helpers.ex b/lib/live_beats_web/live/live_helpers.ex index 2dc8eb5..16d57cb 100644 --- a/lib/live_beats_web/live/live_helpers.ex +++ b/lib/live_beats_web/live/live_helpers.ex @@ -126,9 +126,9 @@ defmodule LiveBeatsWeb.LiveHelpers do assigns = assign_new(assigns, :class, fn -> nil end) ~H""" - + <%= live_redirect to: @navigate, class: @class do %> <%= render_slot(@inner_block) %> - + <% end %> """ end