brandonhilkert
brandonhilkert

Reputation: 4475

React JSX compiling

I'm trying to add the class name "active" to links when they are clicked. I can't get this JSX to compile.

      <li onClick={this.showDeals}><a className={(this.props.panel == 'deals') ? 'active' : ''>Deals</a></li>
      <li onClick={this.showTasks}><a className={(this.props.panel == 'tasks') ? 'active' : ''>Tasks</a></li>
      <li onClick={this.showActivities}><a className={(this.props.panel == 'activities') ? 'active' : ''>Activities</a></li>

What am I doing wrong?

ReactifyError: content.js: Parse Error: Line 740: Invalid regular expression while parsing file

Upvotes: 0

Views: 1105

Answers (1)

user217782
user217782

Reputation:

You need to close your className={... 's.

Upvotes: 3

Related Questions