Languages
[Edit]
EN

Markdown - how to highlight React / JSX syntax on stackoverflow

0 points
Created by:
Dirask Community
5460

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:

React JSX syntax hilighting on Stack Overflow
React JSX syntax highlighting on Stack Overflow
Native Advertising
­čÜÇ
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

ÔŁĄ´ŞĆ­čĺ╗ ­čÖé

Join