The form handlers are not attached when SSR is enabled #1313
Unanswered
lakshmajee
asked this question in
Help (React)
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am using inertia.js with rails framework and adding
ssr
integration usinginertiajs/server
package.I have created a simple form to save some data into the database. When I submitted the form it is always reloading the same page.
After debugging I came to know that, the event handlers for the
form
or any otherinput
elements are not attached due toReactDOMServer.renderToString
.How do I make my form submission work with
SSR
feature ?Thanks in advance 🙏 .
Note: This is more related to universal rendering. How do we support universal rendering ? By using client-side and server-side inertia integration, it loads the components unnecessarily (twice - one in
ssr.tsx
and another inclient.tsx
).Lets assume a component name
Hello.tsx
is requested by server (rails or laravel whatever), thenHello.tsx
is loaded byssr.tsx
on the server to generate static HTML markup andclient.tsx
on the browser (again). Thus it causes performance bottleneck.Beta Was this translation helpful? Give feedback.
All reactions