React - Add Inline Styles in React

Tell us what’s happening:

Describe your issue in detail here.
test fails but looks ok to me

Your code so far

// Change code above this line
class Colorful extends React.Component {
  render() {
    // Change code below this line
    const styles = {
      color: 'purple',
      fontSize: 40,
      border: '2px solid purple'
    }
    return (
      <div style={styles}>Style Me!</div>
    );
    // Change code above this line
  }
};

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36

Challenge Information:

React - Add Inline Styles in React

Declare the styles constant as a global variable at the top of the file.

const styles = {}

class Colorful extends React.Component {}
2 Likes

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.