>

CODEMASTERYLAB

IDE PLATFORM
CoursesCommunity BlogsKnowledge GraphQuizzesInterview Prep

Sign in to track progress & earn XP

Sign In Create Account
>
Code Mastery Lab

Code Mastery Lab

Sign In

JSX — Writing HTML-like Syntax in JavaScript

Question 1 / 1

0:00
Core
Medium

A developer writes the following JSX and Babel reports a syntax error:

const ColorCard = ({ title, color, rating }) => (
  <div class="color-card">
    <h2>{title}</h2>
    <div style={backgroundColor: color} />
    <p>Rating: {rating}/5</p>
  </div>
)

Which line causes the Babel syntax error, and why?