26 questions for “Effects & Lifecycle”

Found in 1 field. Select a question to see its full answer.

Information Technology

26 questions in 1 technology

#QuestionTechnologyTopicLevel
1What is the difference between useEffect and code that runs directly during rendering? React › Effects & LifecycleReactEffects & LifecycleBeginner
2How would you fetch data safely inside useEffect while avoiding a common bug called a race condition? React › Effects & LifecycleReactEffects & LifecycleAdvanced
3What is the useEffect hook used for in React? React › Effects & LifecycleReactEffects & LifecycleBeginner
4What does the dependency array in useEffect actually control? React › Effects & LifecycleReactEffects & LifecycleIntermediate
5How do you clean up an effect in React, and why is it important? React › Effects & LifecycleReactEffects & LifecycleIntermediate
6What does componentDidMount do in a class component and what is its equivalent using hooks? React › Class Components & Legacy Lifecycle MethodsReactClass Components & Legacy Lifecycle MethodsIntermediate
7What is componentDidUpdate used for, and what mistake should you watch out for when using it? React › Class Components & Legacy Lifecycle MethodsReactClass Components & Legacy Lifecycle MethodsAdvanced
8Why does Strict Mode call component functions and certain effects twice during development? React › Strict Mode & Concurrent FeaturesReactStrict Mode & Concurrent FeaturesIntermediate
9What is a custom hook in React and why would you create one? React › Custom HooksReactCustom HooksBeginner
10What problem do libraries like React Query and SWR solve compared to fetching data with plain useEffect? React › Data Fetching (React Query & SWR)ReactData Fetching (React Query & SWR)Beginner