I love stimulus. And Hotwire. I find everything more maintainable and faster to developer when rails on the centre of the universe. Obviously a personal preference.
I faced a similar display toggle-able use case for form fields recently.
I did find that I used stimulus to hide the fields there was a slightly “flicker” as they appeared and then were hidden in the connect() function.
It didn’t affect my use case, as I could default hide and then toggle them to appear with stimulus.
But in the event they should appear by default and then be hidden based on some logic within the stimulus controller, is there a better way to handle this?