Phoenix LiveView: trouble with nested LiveView

I have a page, “/foo”, which has multiple Bootstrap tabs. These tabs are accessible by visiting “/foo” and clicking on the tab, or directly with the tab preselected at “/foo/bar” and “/foo/baz.” Each tab consists solely of a Phoenix LiveView rendered via live_render. However, there is an issue, and the solution to that causes another issue.

If I simply render the LiveView, and click on from the bar tab to the baz tab and then back to the bar tab, the bar tab does not render the second time. I was able to solve this by including :erlang.unique_integer as the id element for the live_render.

Unfortunately, this causes problems when I try to access the tab directly via the /foo/bar URI. The LiveView renders twice, causing an issue with the LiveView JS and shutting down JS execution until the tab is changed.

Can anyone help me troubleshoot a solution to this? The second issue may be related to this bug: https://github.com/phoenixframework/phoenix_live_view/issues/870 but I would prefer a solution that allowed me to avoid rendering the view a second time, which would avoid the bug altogether.

Thanks!