I’ve got a tabbed interface currently with two separate LiveViews, each with their own live route (e.g.
live "/one", OneLive and
live "/two", TwoLive in the router).
The live layout uses
live_redirect for the tabs that switch between the two.
I don’t love the slight delay when clicking a link and a LiveView re-mounts. I’d like for both LiveViews to stay loaded for the duration of the user’s session.
What’s a good option here to load both LiveViews at the same time but let me navigate between them?
Put them both in the same non-live page with two
<%= live_render … %> and make JS tabs to hide/show one or the other? And write my own push state stuff if I want the URL to be different?
Or perhaps nested LiveView components, where the outer one is responsible for the tabs and does push state stuff to the URL via LiveView hooks?