O'Reilly logo

Developing a React Edge, 2nd Edition by Simon Højberg, Frankie Bagnardi, Richard Feldman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 2. JSX

In React, components are used to separate concerns, not templates and display logic. When using React, you must embrace the idea that markup, and the code that generates it, are inherently tied together. This gives you all of the expressive power of JavaScript when building your markup, without having to resort to awkward or cumbersome templating languages.

React works well with an optional markup syntax, and is remarkably similar to HTML. But before proceeding, let’s get one thing out of the way—for those put-off by the apparent awkwardness of markup in JavaScript, and for those not convinced of JSX’s usefulness, consider the many benefits of this approach within React:

  • It allows for familiar markup to define the element tree ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required