Skip to content

Latest commit

 

History

History
28 lines (14 loc) · 1.16 KB

File metadata and controls

28 lines (14 loc) · 1.16 KB

Logo-nav

Kalvium Lab | Custom hooks

Learning Goals

In this exercise, the aim is to understand the concept of custom hooks.

You can follow the links below - to get a better idea of custom hooks.

Article on custom hooks Creating useFetch - custom hook

Task:

Your task is to create a custom hook called -> useStorage --> which stores the value typed in a text field, both into local storage and session storage.

Your ouptut would look something like below: Also, to check whether, your input is being stored or not, you can go to application tab and see the local storage and session storage, options -> like shown below.

NOTE: Notice how, even after refreshing the page, the value in the text field, remains the same.

Happy Coding ❤️!