React/JSX/HTML: How to put a greater-than or less-than symbol in React/JSX/HTML
Date: 2019-10-28 | html | jsx | react | tutorial |
DISCLOSURE: If you buy through affiliate links, I may earn a small commission. (disclosures)
problem
I'm building a web page in React / JSX and need to put a greater-than (>
) and less-than (<
) symbol in my page. How can I do this without the page breaking?
solution
You can wrap your symbols in a code block and insert them as a string!
Example:
<div>{"<"} Less than, {">"} greater than </div>
did this help?
I regularly post about tech topics I run into. You can get a periodic email containing updates on new posts and things I've built by subscribing here.
Want more like this?
The best way to support my work is to like / comment / share for the algorithm and subscribe for future updates.