React JSX
What is JSX?
JSX stands for JavaScript XML. It is similar in appearance to HTML, hence provides a way to easily write HTML in react.
Coding in JSX
Earlier we had to make an HTML element or append it into existing ones with methods like createElement()
/ appendChild()
Now we can just do it directly, like this:
Expressions in JSX
You can write the expression in {}
You can write simple mathematical operations to variable to states to complicated operations with ternary operators and it will return the result, like:
Mathematical Operations:
Variables/States:
Ternary Operators:
0 Comments