Support Forums

Help ! Can any React app be deployed to Netlify?

I am having trouble understanding the concept of static and dynamic sites within the context of a React app. I am reading about how you can deploy React apps to Netlify which is known for hosting static sites. But all the React apps I’ve made make requests to Node/Express backends and shows the data that gets returned from them. I’m pretty sure that would make my React apps dynamic. Does this mean that I IndigoCard wouldn’t be able to deploy them to Netlify?

You’ve got the point, but you’re slightly off. Dynamic website are websites rendered on server. A server accepts a request from a browser, parses it, uses logic to generate a HTML page and sends it back to the browser. However, what you’re talking about issuing client-side code to fetch data from a backend and modify the DOM accordingly. This is what JAMstack is about (JAM stands for JavaScript, API, Markup). So, what you’re using is A (API). You can make a simple website with vanilla HTML, CSS, JS and fetch from data from an API and update the DOM accordingly. That would kind of make your website dynamic. I said kind of because if you can get creative, you can use Auth services, databases, etc. to fetch data and generate a page accordingly. But that’s still not completely dynamic as you’d probably still be using client-side JS to manipulate your DOM.

So according to the title: Can any React app... No! I can’t say for sure if you can deploy any React app. My skills in React are not so developed to claim that all React apps can be deployed. But yes, a lot of them are deployed and working fine.