Writing a math expression as text can make it quite ugly
<p>λy.xy</p>
Doing it with MathML seems better
<math xmlns="http://www.w3.org/1998/Math/MathML">
<mi>λ</mi>
<mi>y</mi>
<mo>.</mo>
<mi>x</mi>
<mi>y</mi>
</math>
(On math stack exchange it's even nicer with the same MathML:
, but I'm not sure yet how to get that without MathJax)
I want to have the nicer look in my React app, but it doesn't seem to accept the <math> tag. Is there a solution that would be similar to JSX and let me use React interactivity like the HTML below?
<math xmlns="http://www.w3.org/1998/Math/MathML">
<mi onClick="console.log('hello')">λ</mi>
<mi>y</mi>
<mo>.</mo>
<mi>x</mi>
<mi>y</mi>
</math>


The
mathelement appears to be perfectly valid HTML, which means it should work just fine in JSX in React as well. The only issue I see in your JSX is with themielement'sonClickhandler. You've specified a string value when it should be a function in JSX, e.g. changeonClick="console.log('hello')"toonClick={() => console.log('hello')}.Example: