Coder Social home page Coder Social logo

component-based-design's Introduction

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

Priorities: πŸ₯š, 🐣, πŸ₯, πŸ” (click to learn more)

There is a lot to learn in this repository. If you can't master all the material at once, that's expected! Anything you don't master now will always be waiting for you to review when you need it. These 4 emoji's will help you prioritize your study time and to measure your progress:

  • πŸ₯š: Understanding this material is required, it covers the base skills you'll need for this module and the next. You do not need to finish all of them but should feel comfortable that you could with enough time.
  • 🐣: You have started all of these exercises and feel you could complete them all if you just had more time. It may not be easy for you but with effort you can make it through.
  • πŸ₯: You have studied the examples and started some exercises if you had time. You should have a big-picture understanding of these concepts/skills, but may not be confident completing the exercises.
  • πŸ”: These concepts or skills are not necessary but are related to this module. If you are finished with πŸ₯š, 🐣 and πŸ₯ you can use the πŸ” exercises to push yourself without getting distracted from the module's main objectives.

  • recreate an HTML/CSS web page using pure functions components and encapsulated styles

πŸ₯š JSX : you can ...

  • Write elements with JSX syntax
  • functional React components
  • render a static page with provided data
  • component props
  • splitting components with design in mind

πŸ₯šfunctional React components: you can ...

  • Create a React function component (both function definition and arrow function styles)

  • Import/export components between files

πŸ₯š Render data: you can

  • Use interpolation ({}) to insert JavaScript expressions into JSX
  • Render a list using the .map method

πŸ₯š Components and props : you can ...

  • create small, reusable components
  • how to pass props into React components

πŸ₯š Create reusable components: you can ...

  • Nest components within other components
    • one folder with a main component
    • sub-components for your convenience (not part of public contract)
  • VDOM
  • what is a hook
  • useState
  • useEffect (any side-effect)
  • component lifecycle

πŸ₯šVDOM : you ....

  • can differenciate the real dom from the virtual dom
  • know what reconciliation process is ..

πŸ₯š Hook

  • simple, just enough for the flavor
  • the react docs "rules of hooks"

πŸ₯š use-state

πŸ₯š use-effect

πŸ₯š component lifecycle

  • create components that manage internal state and emit custom events
  • handling events
  • build reusable components that take functions as arguments
  • child components communicating with parent components
  • passing functions as props
  • splitting components with logic in mind
    • why create dumb components when hooks can be anywhere?
  • re-render cycles (all children)
    • why putting state at lower levels is efficient
    • why not to use everything in global state
  • fetch and use API data in components
  • async useEffect callbacks
  • react router
  • being careful about what you put in useContext
    • only move data to context when it's necessary
  • store and manage global app state shared between components
  • useContext
    • shared state, not the same as useState
  • other state management systems/strategies exist

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

  • props
  • importing local style sheets

Synthetic Events

  • handling
  • dispatching

Hooks

  • useState
  • useContext
  • useEffect

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

  • React component files are Pascal Case
  • React component functions are Pascal Case
  • React component files have the .jsx extension
  • all other files & folders are Kebab Case
  • all other functions are Camel Case

TOP


Study Tips

expand/collapse
  • Don't rush, understand! Programming is hard.
    • The examples and exercises will still be there to study later.
    • It's better to fail tests slowly and learn from your mistakes than to pass tests quickly and not understand why.
  • Don't skip the examples! Understanding and experimenting with working code is a very effective way to learn programming.
  • Write lots of comments in the examples and exercises. The code in this repository is yours to study, modify and re-use in projects.
  • Practice Pair Programming: two people, one computer.
  • Take a look through the Learning From Code guide for more study tips

Study Board

Creating a project board on your GitHub account for tracking your study at HYF can help you keep track of everything you're learning. You can create the board at this link: https://github.com/your_user_name?tab=projects.

These 4 columns may be helpful:

  • todo: material you have not studied yet
  • studying: material you are currently studying
  • to review: material you want to review again in the future
  • learned: material you know well enough that you could help your classmates learn it

TOP


Getting Started

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

  1. Clone this repository:
    • using SSH: git clone --depth 1 [email protected]:HackYourFutureBelgium/component-based-design.git
  2. navigate to the cloned repository
    • cd component-based-design
  3. Install dependencies:
    • npm install

TOP

component-based-design's People

Contributors

colevanderswands avatar gelilaa avatar jbelien avatar kevintss avatar maeligg avatar omerjava avatar samirm00 avatar yoshimalaise avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.