Interactivity for Server Components without Client Components.
React Server Components are rendered on the server and are sent to the browser as RSC payloads. They are not hydrated and are therefore not interactive.
To add interactivity, you are recommended to replace parts of the Server Components with Client Components. Client Components will additionally send JavaScript to the browser so that the components can be hydrated and hence made interactive.
However, this is not the only way.
Developers have used either vanilla JavaScript or jQuery to add interactivity to HTML pages for decades since the beginning of JavaScript. You can use any of these techniques instead of Client Components.
Here, I demonstrate how to add interactivity to React Server Components without using Client Components. I will demonstrate using jQuery and Hotwire Stimulus, in addition to Client Components.