inertia-rails
inertia-rails copied to clipboard
event handlers are not bounded, with hydrateRoot
Versions:
inertia_railsversion: 3.0
Describe the problem:
The javascript event listeners are not attached to the HTML even after hydrating.
Example: let's assume there is an event handler registered for an input field named name. Whenever the user changes the value in the text field, the event listeners should fire.
Steps to reproduce:
Reproduction repository: https://github.com/awkward-minion/inertiajs-react-form-handlers.git
The browser renders this problem without any issues.
But the event handlers like handleSubmit and handleChange are not registered after the hydration.
Observations
- SSR is properly generating HTML markup along with layout
- Client-side
hydrateRootwas not displaying any warnings, considering it as good. The javascriptbundleis being loaded in the browser. (the event handlers) - Problem - the event handlers are not bonded
Raised issue in inertia.js rails repository