First time posting here and fairly new to phoenix. Just need some help optimizing my project with handling events coming from the layouts.ex file, I just need to toggle my mobile navigation side bar, and I can grossly achieve this by putting the handle_event in every live view, but when I try to copy the Live beats project with the nav.ex setup with an attach_hook, I can’t seem to get it to work
edit: I realised live beats achieves this using functions in the core_components directory.
Hello and welcome!
As @sanswork pointed out, menu toggling—or any UI interactions that don’t need the server—is best done with JS. Check out JS Commands.
Otherwise, it’s not a terrible exercise to store menu state on the server in terms of learning hooks. Can you post what you have tried? It’s not really possible to help if we can’t see code!