React JSX

Agenda of this session

React JSX

React JSX

  • JSX stands for JavaScript XML.
  • JSX allows us to write HTML in React.
  • JSX makes it easier to write and add HTML in React.

JSX provides you to write HTML/XML-like structures (e.g., DOM-like tree structures) in the same file where you write JavaScript code, then preprocessor will transform these expressions into actual JavaScript code. Just like XML/HTML, JSX tags have a tag name, attributes, and children.

JSX Attributes

JSX use attributes with the HTML elements same as regular HTML. JSX uses camelcase naming convention for attributes rather than standard naming convention of HTML such as a class in HTML becomes className in JSX because the class is the reserved keyword in JavaScript. We can also use our own custom attributes in JSX. For custom attributes, we need to use data- prefix. In the following example, we have used a custom attribute data-demoAttribute as an attribute for the < p > tag.



We have our own LMS. SMARTLEARN is cloud based user-friendly Learning Management System. You will get 24 X 7 hours access by login with a unique username and password. The full course content has been uploaded in the LMS. Please Register with us. After registration you will get the login details.  Register Now