πŸ“Š React Js
Q. How do you prevent a form submission from refreshing the page in React?
  • (A) By calling event.preventDefault() in the submit handler
  • (B) By using type='button' on the submit button
  • (C) By removing the form tag
  • (D) By using useState hook
πŸ’¬ Discuss
βœ… Correct Answer: (A) By calling event.preventDefault() in the submit handler

Explanation: Calling event.preventDefault() stops the default form submission behavior.

Explanation by: Mr. Dubey
Calling event.preventDefault() stops the default form submission behavior.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
61
Total Visits
πŸ“½οΈ
9 mo ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
99%
Success Rate