-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

React Interview Guide
By :

It is recommended that you use JSX with React to describe what the UI should look like in a web application. Even though JSX is not mandatory to use in React, it comes with several advantages, all of which we’ll cover here.
JSX is an XML-like syntax extension of the JavaScript language that’s based on ES6, which means you can structure component rendering using syntax such as HTML. This means it is just syntactic sugar that allows you to write HTML inside JavaScript and place it in the DOM without using any createElement()
or appendChild()
methods.
Let’s look at an example of a simple JSX code snippet to better understand how it works:
const myElement = <h1>This is my first JSX code</h1> ReactDOM.render(myElement, document.getElementById ('root'));
After rendering the code, React outputs the content inside the <h1>
tag to your DOM.
The plain JavaScript code snippet without the...