bf-component-based-design

Component-Based Design

Learn to design, plan and build frontend applications using a Component-Based approach. You will explore the ReactJS library which is designed to make Component-Based design easy and efficient.


Learning Objectives

1. Rendering Static Pages

JSX : you can …

2. Rendering Data

functional React components: you can …

Render data: you can

Components and props : you can …

Create reusable components: you can …

3. Stateful Components

VDOM : you ….

Hook

use-state

use-effect

component lifecycle

4. Events

5. Component Structure

6. Consuming APIs

7. Frontend Routing

8. Global State

TOP


Just Enough React

React is a big library with a lot of history and different ways of doing things. To help you be productive faster, you’ll only be learning a small part of everything React can do.

JSX

JSX is not actually part of React, but they’re almost always used together

Functional Components

Synthetic Events

Hooks

React Router

not part of the core React library

TOP


Project Folder Structure

The wild world of React is full of different ways to structure applications and organize your code. You’ll be learning one way to do things, this architecture is simple enough to learn in a couple weeks and capable enough to build a final project.

/react project
  /public
  /src
    /api-calls
      - functions that fetch and process API data
    /components
      - React components
      - more important to talk about the decision process
        than suggesting a specific folder structure
      /shared
        don't force it, let it happen
      /Component
        Component.jsx
        SubComponent.jsx
        styles.css
      App.jsx
        <header>
        <routes>
        <footer>
    /context
      - initialize React context with ../data
    /data
      - initial app state
    /utils
      - testable logic functions
  /LICENSE
  /package.json
  /README.md

Conventions

TOP


Getting Started

You will need NPM installed on your computer to study this material

  1. Fork this repository:
    • https://github.com/HackYourFutureBelgium/bf-component-based-design
  2. Clone it using HTTPS
  3. navigate to the cloned repository
    • cd component-based-design
  4. Install dependencies:
    • npm install

TOP