score:1

Accepted answer
<div className="todo" style={{text-decoration: todo.isCompleted ? 'line-through' : 'none' }}>{todo.text}</div>

score:1

<div 
   className="todo"
   {...(todo.isCompleted && {style: {textDecoration: 'line-through'}})}
>
  {todo.text}
</div>

Related Query

More Query from same tag