Summary
In this chapter, we started with the function of React in web development. We went into three aspects of it. First, we went through the latest ES6 features of JavaScript, such as the arrow function and template strings. Next, we learned the CSS-in-JS approach to bring CSS into JavaScript, using libraries such as styled-JSX
and styled-components
. Last, but not least, we learned how HTML-like JSX code is transformed and returned as React elements. All in all, we saw how React pulls all these resources together, including JavaScript, CSS, and HTML, to help us build a site.