Upgrade to Pro — share decks privately, control downloads, hide ads and more …

React JS Hooks - Why and How?

React JS Hooks - Why and How?

In this workshop, we'll take a brief look at React JS hooks, why they are needed and how they can be implemented.

Speakers/Mentors
Kartik Agarwal (https://twitter.com/kartikag01)

Agenda
- Registration and introduction.
- Why do we need hooks?
- Intro to the hooks API.
- Converting stateful components into hooks.
- Debugging hooks state with chrome dev tools.
- Converting life-cycle methods into hooks.
- Creating custom hooks.

Prerequisites
- Intermediate JS knowledge.
- Basic knowledge of ES6 and React JS.
- Node JS and NPM (to be installed on your systems).

Avatar for KARTIK AGARWAL

KARTIK AGARWAL

August 18, 2019
Tweet

Other Decks in Technology

Transcript

  1. Agenda • Why do we need hooks? • Problems faced

    in the traditional components • How can we solve them • React Hooks introduction • Overview on Hooks apis • Converting stateful components into hooks • Diving into hooks • Debugging hooks state with chrome dev tools • Converting life-cycle methods into hooks. • Creating custom hooks.
  2. How to deal with that • Mixins (The old way)

    • Higher Order Component • Render Props
  3. Here comes hooks Hooks are a new addition in React

    16.8. They are just functions and let you use state and other React features without writing a class.
  4. Rules For Hooks • Must be called at Top Level

    • Can be called from React functional Component
  5. Hooks Apis • useState • useEffect • useContext • useReducer

    • useCallback • useMemo • useRef • useImperativeHandle • useLayoutEffect • useDebugValue