[Hooking]: A hook, in programming is a method that modifies an application's behaviour using callback functions. Wikipedia
There are many kinds of hooks in programming in many different contexts.
In React, before version v16.8 (06/02/2019) components were created using classes or functions.
Classes components were mandatory when there was any kind of lifecycle or state management.
Nonetheless, class components are verbose and not very straightfoward to convert to and from function components in case of a refactoring.
The introduction of Hooks, in version v16.8
allowed the complete remplacement of class based components to function based components.
The React team created some hooks to manage lifecycle components and many libraries introduced them in order to interact with the library.
This repo contains information on a few of the them.
Reveal.js was used to create a presentation.
To launch the presentation:
- Make sure npm is isntalled, by running
npm --version
on your terminal. - Execute the following commands
# Launch presentation
cd reveal.js
npm install
npm start
- Next, open the presentation in
localhost:8000
.
A few examples can ba found in the folder /hooks
.
Each folder is an entire React application.
If you wish to launch it:
- Make sure npm is installed.
- Execute the following commands
# Launch React applications
cd hooks/<hook>
npm install
npm start
- Next, you can open the application on
localhost:3000
.
Each hook implements a different fonctionality that can be observed in code, browser or in the console.
Any suggestions, corrections and questions are more than welcome in the issues tab.