coding180 icon

What is JSX?

Home > Interviews > Javascript

robort - 2022-10-05 03:28:51

JSX stands for JavaScript XML.

It is a React extension that allows you to write JavaScript code that looks like HTML. It simplifies the understanding of HTML files.

JSX files strengthen and improve the performance of React applications. JSX allows XML-like syntax to be written in the same file as JavaScript code, and then a preprocessor (such as Babel) converts these expressions into actual JavaScript code.

JSX tags, like XML/HTML tags, have tag names, attributes, and subtags.


class App extends React.Component {  
  render() {  
        <h1>Hello World</h1>  

In the example above, <h1> the text inside the tag is returned to the render function as a JavaScript function. After compilation, the JSX expression becomes a normal JavaScript function, as in the following example:

React.createElement("h1", null, "Hello world");






Robort Gabriel

Lagos, Nigeria

Freelance Web Developer, Native Android Developer, and Coding Tutor.

  • UI / UX
  • JavaScript
  • Python
  • PHP
  • Kotlin
  • Java
  • Bootrap
  • Android
  • Laravel