Can I inject other programming languages besides JavaScript into JSX?

Question

Can I inject other programming languages besides JavaScript into JSX?

Answer

No, we cannot inject other programming languages other than JavaScript into JSX. We can only inject vaild JavaScript expression into JSX by wrapping the JS expression in curly braces.

11 Likes

Do not understand 20 Pi figures in JSX result 2 + 3 = 5?

Hi Adrian,

the code:

‘Math.PI.toFixed(20)’

is part of the file pi.js

instead of the example with 2 + 3 = 5 is part of of the file app.js

They are two different piece of code.

The Math.PI property represents the ratio of the circumference of a circle to its diameter, approximately 3.14159