
Use Greater‑Than and Less‑Than Symbols in JSX

Putting the less than (<) or greater than (>) symbols into the JSX of your React app should be very straightforward. Even as a front‑end developer with over a decade of experience, it took me longer than I should admit to work the solution out...
<> <p>{'<'} - less than</p> <p>{'>'} - more than</p></>It makes perfect sense: in JSX, the curly braces inform the JSX parser that the contents should be interpreted as JavaScript, the quotes then define a string, so whatever is within the quotes will simply be parsed and output as‑is.
You could ‑ of course ‑ simply use the HTML/XML escape codes:
<> <p>< - less than</p> <p>> - more than</p></>The same approach can be used to output more or less any special characters:
<> <p>® is the same as {'®'}</p> <p>© is the same as {'©'}</p> <p>™ is the same as {'™'}</p></>One thing of note though: this same technique cannot be used to output HTML comments, for that you need an altogether different approach.
{'<!-- This will not be rendered as an HTML comment! -->'}Fin.
Related Articles

Reducing Image Brightness with CSS. 
Understanding the Difference Between <b> and <strong>. Understanding the Difference Between
<b>and<strong>
Disabling Gatsby Telemetry. Disabling Gatsby Telemetry

HTML Video and the preload Attribute. HTML Video and the
preloadAttribute
LeetCode Container with Most Water: The Two‑Pointer Solution. LeetCode Container with Most Water: The Two‑Pointer Solution

Graph Traversal: Solving the 'Course Schedule' Problem. Graph Traversal: Solving the 'Course Schedule' Problem

How to Hire a JavaScript Developer. How to Hire a JavaScript Developer

Solving the 'Jump Game' Problem with Greedy Algorithms. Solving the 'Jump Game' Problem with Greedy Algorithms

Flexbox vs. grid. Flexbox vs.
grid
JavaScript Error Handling Patterns. JavaScript Error Handling Patterns

Vue's provide/inject API: When and How to Use It. Vue's
provide/injectAPI: When and How to Use It
Understanding the JavaScript Event Loop. Understanding the JavaScript Event Loop