We have been using JSX so far, but what does it mean? JSX stands for JavaScript extension. How can it be an extension?
As you probably know, ECMAScript is also an extension to JavaScript (kind of). ECMAScript transpiles to JavaScript. What does this mean? It means that it just transforms ECMAScript code into valid JavaScript code. JavaScript misses out on many features that we like from ECMAScript, such as arrow functions, classes, and destructuring operators.
JSX works the same way. JSX is being transpiled to JavaScript, and its main feature is creating React elements based on the markup you write.
Could we use only JavaScript? Yes. Is it worth it? Most likely not.
Let's check this out in action. This is JSX and ECMAScript:
export default () => <Text style={{marginTop: 30}}>Example Text!</Text>
Now, compare this to pure JavaScript:
export...