shahryarjb
Remounting when LiveComponent is called inside stateless component LiveView
Hello, based on my understanding, the order of calling module in LiveView should be like this:
Live → Live Component → Stateless Component
I have a LiveView module that call a stateless component which has a Live Component inside itself; after changing parent state I mean LiveView module the Live Component mount is being reloaded instead of update function.
Is there any chance to force it not to load mount function?
Phoenix LiveView: 0.18.18
Phoenix: 1.7.0
Before seeing code, I have nested components in my project something like this:
<dashboard> // state less
<layout> // state less
<setting> // state less
<LiveComponentA>....</LiveComponentA> // LiveComponent
</setting>
</layout>
</dashboard>
LiveView module:
Stateless component
And:
And:
Live Component
Thank you in advance
Marked As Solved
LostKobrakai
The live component will always remount when its id is changed. You’re giving it a random ID, which means it remounts whenever the parent updates.
Also Liked
BradS2S
Taking a bullet for the rest of us. We are doing God’s work for developers not even born yet. ![]()
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance










