Im want to write copyright symbol in React component, but this doesnt work.
function Footer() {
return (
<footer>
<p>©</p>
</footer>
);
}
<p>©</p> works in HTML online editor.
If you wrote what you had in HTML and ran it through a validator it would report:
Error: Named character reference was not terminated by a semicolon. (Or
&should have been escaped as&.)
Most HTML parsers perform a lot of error recovery. JSX is not so forgiving. The semi-colon on the end of a character reference is mandatory:
<p>©</p>
Alternatively, just use a copyright sign directly:
<p>©</p>
You can use © for the copyright symbol in React component.
function Footer() {
return (
<footer>
<p>©</p>
</footer>
);
}
use this tag it works event i used the same in HTML: © in JSX : © or direct ©