πŸ“Š React Js
Q. How can you pass a function as a prop in React?
  • (A) Just pass the function reference in the props object
  • (B) Call the function and pass the return value
  • (C) Use eval() to bind the function
  • (D) Functions cannot be passed as props
πŸ’¬ Discuss
βœ… Correct Answer: (A) Just pass the function reference in the props object

Explanation: Functions can be passed as props to allow child components to call them.

Explanation by: Mr. Dubey
Functions can be passed as props to allow child components to call them.

πŸ’¬ Discussion


πŸ“Š Question Analytics

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