Replies: 1 comment 1 reply
-
Hi @meeoh! Inertia.js is a great solution for this. Highly recommend reading their docs, but in summary, the first request to the server allows you to return the data that your client-side app will use, and will pass it as props to your page components. If you are looking for something lighter, you can pick up a few tricks from Inertia, like serializing your JSON data into your HTML using a I'd definitely try Inertia first though 😃 |
Beta Was this translation helpful? Give feedback.
1 reply
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.
-
Hey, loving vite_ruby so far. Using it with React. Is there a way to pass data to my client side comopnents on the initial request? E.g doing something like:
<%= vite_typescript_tag 'application.tsx' user={current_user} %>
My alternative is that when someone visits my application, i'll first have to make a request to my API layer and see if the users logged in and display info based on the result of that call.
I would assume theres some way to do this similar to the rails/webpacker approach
Beta Was this translation helpful? Give feedback.
All reactions