Ask A Question

Notifications

You’re not receiving notifications from this thread.

What should I be using to connect react to rails backend?

dnoetz asked in Rails

Hello all, apologies if this has been asked before. I currently work with react and node/express for the backend, but have been playing around with rails on the side and have been really enjoying it. I’d like to use react for my front end and was wondering what the industry standard was for connecting react to a rails backend? I’ve been doing research on it and I’ve seen that importmap is the default from what I understand, but that esbuild or webpack is preferred? Anyone have insight to offer?

Reply

It is possible with import maps but it is probably a better idea to use esbuild for React as your front end. Import maps is the default for Rails 7, but once the javascript gets complicated or has more then 5 or so dependencies it is better to use esbuild.

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 87,563+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.