In my app I have a function component that renders the top navigation bar, consisting of a number of buttons.
Is there a way to do a client side redirect using a button? I read Live view client side redirect via a form but it’s a bit dated already.
Wouldn’t it be possible to implement something like
<button phx-click={JS.redirect(~p"/goto")}>Go!</button>
…?
Otherwise I guess I need to make the nav bar a Live component and have it receive the click events, right?