EN
Markdown - how to highlight React / JSX syntax on stackoverflow
0
points
In this article, we would like to show you how to highlight React JSX syntax on Stack Overflow.
Quick solution:
```react
// some react code here
```
Note:
Using
```jsx
at the beginning of your code works fine for some sites that use markdown (like dev.to or github.com), unfortunately it doesn't work well on Stack Overflow.
To highlight syntax in your block of code on Stack Overflow you need to specify the language in the first line, right after three backticks ```
.
In this case instead of jsx
we need to use react
keyword.
Practical example:
```react
import React from 'react';
const App = () => {
return (
<div>
My App
</div>
);
};
export default App;
```
Result: