React HooksLesson 46Free preview
What is Hooks?
This lesson is part of React · All levels
Summary
Hooks are built-in React functions that allow functional components to use state and life cycle without writing class. useState, useEffect, and useContext are the most common examples. There is a mandatory rule: Hooks can only be called at the top of a functional component, not under conditions or repetitions.
Key points
- Hooks are used in functional components, not class.
- Call Hook only at the highest level of the component function
- The name Hook always begins with the word use.
- UseState for state, useEffect for side effects
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.