Challenge - 5 Problems
React Ecosystem Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate2:00remaining
Understanding React Server Components
Which statement best describes React Server Components (RSC)?
Attempts:
2 left
💡 Hint
Think about where the component code runs and what is sent to the browser.
✗ Incorrect
React Server Components run only on the server. They render UI and send HTML to the client without sending JavaScript for those components, improving performance.
❓ component_behavior
intermediate2:00remaining
Behavior of useState in React 19+
What happens when you call the setter function from useState multiple times synchronously in a React 19+ functional component?
React
const [count, setCount] = useState(0); setCount(count + 1); setCount(count + 1); // What is the value of count after these calls?
Attempts:
2 left
💡 Hint
Remember that state updates are batched and the setter uses the current closure value.
✗ Incorrect
Both setCount calls use the same initial count value (0), so count increments only once to 1.
📝 Syntax
advanced2:00remaining
Correct use of React Context with useContext Hook
Which option correctly shows how to consume a React Context named ThemeContext inside a functional component?
React
const ThemeContext = React.createContext('light'); function MyComponent() { // How to get the current theme value? }
Attempts:
2 left
💡 Hint
Check the correct syntax for useContext hook usage.
✗ Incorrect
The useContext hook is called with the context object, not a string, and is imported from React.
🔧 Debug
advanced2:00remaining
Identifying a React Hook Rules Violation
What error will this React component produce when rendered?
function Example() {
if (Math.random() > 0.5) {
const [count, setCount] = useState(0);
}
return
Check count
;
}Attempts:
2 left
💡 Hint
Hooks must be called unconditionally at the top level of components.
✗ Incorrect
React Hooks must be called in the same order on every render. Calling useState conditionally breaks this rule and causes an error.
❓ lifecycle
expert2:00remaining
React 19+ useEffect Behavior with Strict Mode
In React 19+ with Strict Mode enabled, what is the behavior of useEffect cleanup and re-run during development?
Attempts:
2 left
💡 Hint
Strict Mode intentionally double-invokes effects in development.
✗ Incorrect
React Strict Mode intentionally runs useEffect cleanup and re-run twice on mount during development to help find bugs in effects.