You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We should try address this but, given that the root element of live components are treated especially, we should forbid phx-hook at the root of LiveComponents.
Environment
Code: https://github.com/borisgoro/hooks_test
I created the app with
mix phx.new hooks_test
and tried upgrading the live view version to 0.20.12, ..., 1.0.0-rc.6 with the same result.Define two hooks:
and a LiveComponent with a "panel" for each hook:
Hook1.mounted() is called on the initial render, but Hook2.mounted() is not called when the Panel 2 button is clicked.
Identical code (without the phx-target stuff) works fine in a LiveView:
Actual behavior
Browser console displays
Hook1 mounted
on initial render, nothing when buttons are clicked.Expected behavior
Browser console displays
Hook1 mounted
andHook2 mounted
when the corresponding button is clicked.The text was updated successfully, but these errors were encountered: