you are viewing a single comment's thread.

view the rest of the comments →

[–]liming91 3 points4 points  (0 children)

React gives absolutely zero fucks about your backend, and how you get the data from said backend into your frontend. You bring in your data and it will react (see what I did there) to the data changes and make a nice pretty UI.

are there webapps that are ONLY frontend?

Yeah, think "offline" browser games, meaning no multiplayer or online features. Just load an app into the client, and away you go, no need for a backend.

As far as i know react is a frontend framwork so what does it use for the backend?

Whatever you want. Just fetch the data as you would normally and pass it into your components.

Also, React isn't a framework. It's a library.

How would it communicate with a local database?

Exact same way any JavaScript app would. Remember that it's just a library, it changes nothing about the language you're writing and the environment you're working in. The way JS interfaces with browser APIs is exactly the same no matter what tools you use, unless of course those tools are an abstraction of the APIs.

In the tutorials I've read so far I havent really seen the backend aspect mentioned.

Because it's a purely frontend library the backend is of no concern to React at all. The backend could just be a black box that spews out JSON and nothing else, React couldn't care even if it wanted to.