# React

## Single Page Application (SPA)

- a application that loads a single HTML page and dynamically updates that page as the user interacts with the app
- to develop SPAs,
  - we need to use a JavaScript framework or library
  - like
    - React
    - Angular
    - VueJs
- advantages
  - fast: similar performance to native apps
  - responsive: the app responds to user interactions (browser size changes),
    - to make the app responsive
      - we need to use CSS media queries
      - frameworks: bootstrap, tailwind
  - user-friendly

## functional programming language

- function is considered as first class citizen
  - function is created as a variable of type function
- function can be passed as an argument to another function
- function can be returned from another function as return value

## function reference

- a reference to a function
- a variable that holds a function body's address

```javascript
// here the function1 is a function reference
// to the function body
function function1() {
  console.log('inside function1')
}

React

React vs Angular

important points

virtual DOM

environment setup

JSX