Funnily enough, a JS library that I often use with Elixir, Phoenix and Live View is StimulusJS (which is part of Hotwire) I also have written a hacky stimulus controller to integrate it with Phoenix hooks for full integration.
Not sure about Rails, haven't used it in more than a decade, but NextJS was a major contributor to massive burnout. Of one thing I'm certain: Phoenix is my last web framework. I love it to bits, and I hope to retire before it stops being cool.