Q. Which is a valid way to apply inline styles in React?

  • (A) style='color: red;'
  • (B) style={{ color: 'red' }}
  • (C) style={color: red}
  • (D) style='color:red;'
πŸ’¬ Discuss
βœ… Correct Answer: (B) style={{ color: 'red' }}
Explanation: In React, inline styles are passed as an object with camelCase properties.
Explanation by: Mr. Dubey
In React, inline styles are passed as an object with camelCase properties.

πŸ’¬ Discussion


πŸ“Š Question Analytics

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