GithubHelp home page GithubHelp logo

z2lai / hooks-workshop Goto Github PK

View Code? Open in Web Editor NEW

This project forked from travellingprog/hooks-workshop

0.0 1.0 0.0 2.04 MB

Repo for my workshop on the advanced use of React Hooks

License: MIT License

HTML 2.04% CSS 6.46% JavaScript 91.50%

hooks-workshop's Introduction

Hooks Workshop

Workshop Instructions

This repo was created for a workshop on React Hooks. It presents examples of traditional React components (built by creating a class that extends React.Component) being converted to functional component that use hooks.

To begin this workshop

  • fork this repo
  • clone the repo locally
  • Use the latest version of Node indicated in the file .nvmrc. If you are using NVM, you can run nvm use
  • Run npm install

Available Scripts

In the project directory, you can run:

npm start

Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.

The page will reload if you make edits.
You will also see any lint errors in the console.

npm test

Launches the test runner in the interactive watch mode.
See the section about running tests for more information.

npm run build

Builds the app for production to the build folder.
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.
Your app is ready to be deployed!

See the section about deployment for more information.

Interesting Reads

Thinking in React Hooks

  • https://wattenberger.com/blog/react-hooks
  • Great explanation of how implementing hooks how you think about the changes happening in your omponents. Includes quick comparisons and some custom hook examples.

A Complete Guide to useEffect

State Management with React Hooks and Context API in 10 lines of code!

React issue: Preventing rerenders with React.memo and useContext hook

  • facebook/react#15156 (comment)
  • The link to this comment on GitHub is actually referenced in the API documentation of useContext. It presents 3 different ways you can try to optimize your use of useContext when it has an object value.

React-Redux Roadmap: v6, Context, Subscriptions, and Hooks

  • reduxjs/react-redux#1177
  • React-Redux decided to switch to using Context in v6, ran into performance issues, ditched it in favor returning to something closer to pubsub for v7. This Github Issue goes into great detail about what problems they ran to and had some interesting tidbits of knowledge they gained from this experience.

hooks-workshop's People

Contributors

travellingprog avatar

Watchers

 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.