Q. In which lifecycle method is it safe to set state in a class component?
β
Correct Answer: (B)
componentDidMount
Explanation: componentDidMount is invoked once after the component is mounted and is safe for setting state.