Skip to content

Instantly share code, notes, and snippets.

Intro to React, Functional Components, and useState

Lesson Objectives

  • Define what React is.
  • Describe how react differs from most other front-end frameworks.
  • Define JSX and use it.
  • Define and create a component.
  • Render data from state.
  • Change the state of a component using events.

React with Context

Setup

  1. cd into the correct directory in our repo and npx create-react-app context
  2. cd into the newly created context directory
  3. open everything in your text editor
  4. run npm start in your terminal to get the app running
  5. Delete the starter code in App.js and replace it with:

Intermediate React

Setup

  • npx create-react-app intermediate-react
  • Delete all starter code in App.js
  • npm start to get the app running

Basic App.js Setup

import React, { useState } from 'react'

Intro to React & Hooks

Lesson Objectives

  • Define what React(and hooks) is
  • Describe how react differs from most other front-end frameworks
  • Define JSX and use it
  • Define and create components
  • Change the state of a component