React JSX | React Js | Tutorial For Beginner | Part 3
ฝัง
- เผยแพร่เมื่อ 7 ก.ย. 2024
- React JSX | React Js | Tutorial For Beginner | Part 3
• React JSX | React Js |...
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 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.
With JSX:
const myElement = h1 I Love JSX! /h1 ;
const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(myElement);
Without JSX:
const myElement = React.createElement('h1', {}, 'I do not use JSX!');
const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(myElement);
Expressions in JSX
With JSX you can write expressions inside curly braces { }.
The expression can be a React variable, or property, or any other valid JavaScript expression. JSX will execute the expression and return the result:
Example :- Execute the expression 5 + 5:
const myElement = h1 React is {5 + 5} times better with JSX /h1 ;
React Js | Tutorial For Beginner Playlist
• React JS | Tutorial Fo...
#Subscribe the Channel Link :- #bansodetechsolution #ajupgrading
www.youtube.co...
If you have any Queries or Doubts DM me on #instagram:- #bansode_ajay_2102
www.instagram....
@AjUpgradingBANSODETECHSOLUTION
LinkedIn Profile
/ aj-upgrading-bansode-t...
Link for slides, code samples, and text version of the video #blogger
bansodetechsol...
Whatsapp Channel Link
whatsapp.com/c...