What exactly tells React to treat a sequence of characters as JSX? For instance, this returns literal strings
const items = this.state.toDoList.map(el => `<li>${el}</li>`);
but this returns JSX objects
const items = this.state.toDoList.map(el => {return <li>{el}</li>});
What’s the magic here? What exactly tells React to treat elements as JSXs, not strings? The combination of the word return
and an immediate angle bracket with no quotes? Or is it something else?
The example code belongs to this challenge