Custom hooks in React
Hooks are reusable functions. When you have component logic that needs to be used by multiple components, we can extract that logic to a custom hook.
Loading video...
useWindowSize hook | Custom Hooks in React (in Hindi)
Concepts
1

useWindowSize hook | Custom Hooks in React (in Hindi)
2

useInitialFetch hook | Custom Hooks in React (in Hindi)
Watch the full video to earn 3
Quizzes
1
What are hooks in React?
Question 1 of 7
1
per question2
Which concepts are exhibited by custom hooks in React?
Question 1 of 7
1
per question3
Can custom hooks internally use React's useEffect and useState hook?
Question 1 of 7
1
per question4
States in two different invocations of a custom hook are totally isolated from each other.
Question 1 of 7
1
per question5
It is highly recommended to prefix your custom hook's name with use
keyword.
Question 1 of 7
1
per question6
Is it necessary to use useState
, useEffect
, or other React hooks to create custom hooks?
Question 1 of 7
1
per question7
Can custom hook be used outside React's component tree?
Question 1 of 7
1
per question