0 votes
in React JS by (23.1k points)
What is JSX?

1 Answer

0 votes
by (23.1k points)

JSX is a XML-like syntax extension to ECMAScript (the acronym stands for JavaScript XML). Basically it just provides syntactic sugar for the React.createElement() function, giving us expressiveness of JavaScript along with HTML like template syntax.

In the example below text inside <h1> tag is returned as JavaScript function to the render function.

class App extends React.Component {

  render() {

    return(

      <div>

        <h1>{'Welcome to React world!'}</h1>

      </div>

    )

  }

}

Related questions

0 votes
0 votes
asked Dec 8, 2020 in React JS by SakshiSharma (30.8k points)
0 votes
asked Mar 1, 2020 in React JS by RShastri (1.7k points)
0 votes
asked Nov 26, 2019 in React JS by AdilsonLima (5.7k points)
0 votes
asked Nov 26, 2019 in React JS by AdilsonLima (5.7k points)
...