Skip to content

Instantly share code, notes, and snippets.

@mvoto
Last active August 11, 2017 14:22
Show Gist options
  • Save mvoto/18e19e2d6cc560969da1480f45fe94d7 to your computer and use it in GitHub Desktop.
Save mvoto/18e19e2d6cc560969da1480f45fe94d7 to your computer and use it in GitHub Desktop.
React basics - study notes

Introduction

React is a js library(not a framework) to build interfaces. It is declarative, we can describe user interfaces by telling React what we want, not telling how to do it.

3 Design Concepts

Component

It is a simple function, receive input and returns output. The input can be props or state. It can be reusable and composable. Can manage private state

Reactive Updates

It reacts to user interaction. Updates to the browser.

Virtual Views in Memory

Write HTML in JS - virtual DOM. Tree reconciliation(regarding to updating only specific pieces on that virtual DOM)

React Components

  • Function component is the simplest function with a simple contract.

  • Class component is a more featured way to render components. It can also receive props, but also handles a private internal state. Props are always fixed values but states can change.

Code moved to: https://github.com/mvoto/react-getting-started

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment