How to pass assigns from root template to other template in Liveview?

Hi I have side navbar in live.html.leex file. And some of menus are generated dynamically in First page(like HomeLive)

def mount(_params, _session, socket) do 
  store_list = Stores.get_all_stores()
  {:ok, assign(socket, store_list: store_list)}

This works for just home_live.html.leex template, If I go to other live page, of course, can’t find @store_list assigns.

How can I pass this assigns to other liveview page?

You cant.

Either move the logic up to the parent liveview or use send(self(), :store_data, data) to send it up to parent.

I would say make your component stateless and do the loading in the liveview is a better design if you are mounting this multiple places.