• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests
June 08, 2022 |12.5K Views
React JSX and Elements
  Share  1 Like
Description
Discussion

We had already stated in our article on Introduction to ReactJS that React is a declarative, efficient, and flexible JavaScript library for building user interfaces. But instead of using regular JavaScript, React code should be written in something called JSX. 
Let us see a sample JSX code:

const ele =const ele = <h1>This is sample JSX</h1>;


The above code snippet somewhat looks like HTML and it also uses a JavaScript-like variable but is neither HTML nor JavaScript, it is JSX. JSX is basically a syntax extension of regular JavaScript and is used to create React elements. These elements are then rendered to the React DOM. We will learn about rendering and DOM in the next article in detail.

React JSX and Elements: https://www.geeksforgeeks.org/reactjs-introduction-jsx/