Context Hooks
Context in React acts as a global store for sharing data between components, allowing distant components to access this data without the need for prop drilling, thereby simplifying state management and making it more efficient.
- useContext
it is
used to consume data from a Context in a functional component.
const Theme ()=>{
const themeDark = useContext(ThemeContext);
//....
}
Built-in React Hooks
In React, built-in Hooks are like tools that empower your components with various functionalities. They give you the flexibility to use different features without having to create class components. You can either utilize the hooks provided by React or mix and match them to create custom hooks tailored to your needs. Here’s a list of all the pre-built hooks available in React.