Successfully reported this slideshow.
Your SlideShare is downloading. ×

React JSX.pptx

Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Upcoming SlideShare
React js   t2 - jsx
React js t2 - jsx
Loading in …3
×

Check these out next

1 of 5 Ad

More Related Content

Similar to React JSX.pptx (20)

Recently uploaded (20)

Advertisement

React JSX.pptx

  1. 1. React JSX
  2. 2. What is 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.
  3. 3. Coding JSX. allows us to write HTML elements in JavaScript and place them in the DOM without any createElement() and/or appendChild() methods.  JSX converts HTML tags into react elements You are not required to use JSX, but JSX makes it easier to write React applications.
  4. 4. With JSX: import React from 'react'; import ReactDOM from 'react-dom/client'; const myElement = <h1>Ace Engineering College</h1>; const root = ReactDOM.createRoot(document.getElementById('root')); root.render(myElement);
  5. 5. Without JSX: import React from 'react'; import ReactDOM from 'react-dom/client'; const myElement = React.createElement('h1', {}, 'I do not use JSX!'); const root = ReactDOM.createRoot(document.getElementById('root')); root.render(myElement);

×