Languages
[Edit]
EN

Markdown - how to make blocks of React code (syntax highlighting - github, dev.to)

3 points
Created by:
Dirask Community
6900

In this article, we would like to show you how to create blocks of React code with syntax highlighting in markdown.

To create a block of React code with syntax highlighting you need to wrap your code with three backticks (```) and tell markdown it's JSX in the first line right after backticks.

Practical example:

```jsx
import React from "react";

const App = () => {
  return (
    <div>
      <h1>My App</h1>
    </div>
  );
};

export default App;
```

Result from github.com:

Markdown - highlighted React code example on github.com
Markdown - highlighted React code example on github.com

Result from dev.to:

Markdown - highlighted React code example
Markdown - highlighted React code example on dev.to

References

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