is the gem compatible with react-rails? #86
-
We have an old project using react-rails gem for Reactjs with webpacker, and we want to move to vite, anyone has experience with vite_ruby and react-rails? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi there! I haven't used The If you are not using server-side rendering and are not using Otherwise, I'd suggest contacting the authors to check if they would be interested—it should be possible to allow passing a |
Beta Was this translation helpful? Give feedback.
Hi there!
I haven't used
react-rails
, but the server-side rendering functionality seems to depend on webpacker.The
react_ujs
library it provides seems to rely on either globals or Webpack'srequire.context
.If you are not using server-side rendering and are not using
require.context
, then it should be possible for you to migrate yourreact-rails
project to Vite.Otherwise,
react-rails
won't work out of the box with Vite, and requires additional work to integrate with Vite Ruby.I'd suggest contacting the authors to check if they would be interested—it should be possible to allow passing a
glob
instead ofrequire.context
to "register" the available components.