React Fundamentals

0% completed

Previous
Next
Quiz
Which of the following describes a primary use case of the useRef hook in React?
A
To pass props to child components.
B
To replace the useState hook for managing dynamic data.
C
To access and modify a DOM element directly.
D
To manage component state and trigger re-renders.
Which of the following is true about the difference between state and ref in React?
A
ref is suitable for storing values that affect the UI rendering.
B
ref values cause re-renders when updated, but state values do not.
C
state values can only be accessed directly through ref.current.
D
Changing state triggers a re-render of the component, while changing a ref does not.

.....

.....

.....

Like the course? Get enrolled and start learning!
Previous
Next