Skip to content

Instantly share code, notes, and snippets.

@lparolari
Last active July 12, 2019 18:48
Show Gist options
  • Save lparolari/b5863d42edaa5871343e31409dbf0000 to your computer and use it in GitHub Desktop.
Save lparolari/b5863d42edaa5871343e31409dbf0000 to your computer and use it in GitHub Desktop.
A simple and introductive guide to react, from a beginner to beginners.

React

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.

Components

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

Implementation

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 Installation

React comes with:

  • Webpack;
  • development server;
  • Babel.

IDE

You can use whatever you want.

Note that VisualStudio Code supports JS syntax highlighting and it has two handy extension:

  • Simple React Snippets
  • Prettier.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment