Q. In which hook can you initialize state from props?

  • (A) useState
  • (B) useMemo
  • (C) useEffect
  • (D) useReducer
πŸ’¬ Discuss
βœ… Correct Answer: (A) useState
Explanation: You can use `useState(() => props.value)` to initialize state from props.
Explanation by: Mr. Dubey
You can use `useState(() => props.value)` to initialize state from props.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
82
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
90%
Success Rate