-
Hi there! import React from "react";
import ReactDom from "react-dom";
import App from "../components/App";
ReactDom.render(<App />, document.getElementById("react-app")); The only thing that it does is mounting a React component in the DOM. Although everything works fine, I noticed a couple of things that I was wondering whether they can be improved through a plugin or a different configuration on my side:
Am I doing something wrong? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
In case it helps debug the issue, here's the PR where I'm adding Vite. |
Beta Was this translation helpful? Give feedback.
This comment has been hidden.
This comment has been hidden.
-
I have added a The helper should be used in any layouts or views that use React components: <%= vite_client_tag %>
<%= vite_react_refresh_tag %>
<%= vite_javascript_tag 'application' %> If you locked the gems optimistically using Vite.React.Refresh.mp4 |
Beta Was this translation helpful? Give feedback.
I have added a
vite_react_refresh_tag
helper that you can use to set up HMR with React.The helper should be used in any layouts or views that use React components:
If you locked the gems optimistically using
~>
, you can upgrade by runningbundle update vite_ruby vite_rails
.Vite.React.Refresh.mp4