React is a JavaScript lobrary for building fast and interactive UI.
Main components of React:
- components, a piece of UI used as indipendent piece of UI;
React is a UI library, so you need other libraries for routing, exc.
Each app has at least one component, the root component. Components are isolated. An application can be represented by a tree of components, e.g.
App
+ NavBar
+ Profile
+ Trends
+ Feed
+ Tweet
+ Like
Components is made by
- a state;
- a render method; inside a JS class.
The out of render method is a react element that maps to a DOM element. (Virtual DOM)
React comes with:
- Webpack;
- development server;
- Babel.
You can use whatever you want.
Note that VisualStudio Code supports JS syntax highlighting and it has two handy extension:
- Simple React Snippets
- Prettier.