Languages
[Edit]
EN

Markdown - how to highlight React / JSX syntax on stackoverflow

0 points
Created by:
Gigadude
431

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

Alternative titles

  1. React - how to highlight JSX code on Stack Overflow
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!

Markdown

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