const nameStyles = (due, complete) => {
if (due && !complete) return {color: "red"};
if (complete) return {textDecoration: "line-through"};
return {};
};
const TodoItem = ({name, due, complete}) => (
{(complete) ? '✔': '*'}
{name}
);
To me, this is much easier to reason about than our CSS.
We can use JavaScript to resolve styles. As the examples get more
complicated, JS does a better job of scaling to the challenge and keeping
isolated decisions isolated.