React Hooks for Beginners
git clone <url>
Clone into the repo
code react-hooks
Open the folder in VS Code
npm install
Install the dependencies
npm start
Runs the app in the development mode.
Open http://localhost:3000 to view it in your browser.
React Hooks
Hooks are the new feature introduced in the React 16.8 version. It allows you to use state and other React features without writing a class. Hooks are the functions which "hook into" React state and lifecycle features from function components. It does not work inside classes.
When to use a Hooks
If you write a function component, and then you want to add some state to it, previously you do this by converting it to a class. But, now you can do it by using a Hook inside the existing function component.