What is React - egnomerator/misc GitHub Wiki

What is React? What a Mystery!

Is it a library?

  • React's landing page (https://reactjs.org/) says that React is "A JavaScript library for building user interfaces"
  • What's another JavaScript UI library? jQuery ... but these 2 JavaScript libraries work vastly differently (more on this later)

Is it a framework?

  • most documentation/demos/tutorials on using React feel like working within a framework
    • and it can be confusing to know which parts of this "framework" are React and which parts are other JavaScript libraries
  • even thought React calls itself a library, it is very commonly referred to as a framework

Is it just for Single Page Application development? ... (no)

React is a JavaScript UI library ... but SPAs

Working with React so commonly feels like working within a framework, because it is most commonly used in SPA development along with a collection of numerous other JavaScript libraries

  • all the libraries working together comprise the SPA, and React is a key part of it, but only a part, only a library

But it is challenging to find documentation/blogs/tutorials that show example "React apps" in a manner that helps distinguish React from the rest of the application libraries.

Even to understand the difference between React and JSX can be a hurtle due to how common it is to see JSX used with React.

Can React be used in a non-SPA web app? How about within an ASP.NET Core MVC app?

As challenging as it can be to learn how to distinguish React parts from other parts of a SPA that are simply other JavaScript libraries, it can be even more challenging to learn how to incorporate React into an ASP.NET Core MVC app.

But incorporating React into an ASP.NET Core MVC app can certainly be done, and it can be very beneficial.

What React Is

As the landing page (https://reactjs.org/) states: "React is a JavaScript library for building user interfaces"

React consists of

React vs. jQuery in terms of browser DOM manipulation

  • jQuery provides the developer an API for direct, imperative browser DOM manipulation
  • React sits between the developer and the browser DOM
    • the developer declaratively tells React how the browser DOM should look
    • rather than write code to directly update the browser DOM, the developer writes code to define changes in component state
    • then, given changes in state, React handles any manipulation of the browser DOM
⚠️ **GitHub.com Fallback** ⚠️