add the old snippet md files
This commit is contained in:
parent
fc0dd204c7
commit
bcf8313a4b
110 changed files with 3048 additions and 0 deletions
30
old_snippets/jsx-comments.en.md
Normal file
30
old_snippets/jsx-comments.en.md
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
---
|
||||
title: "jsx comments"
|
||||
date: 2020-05-26T11:59:43+02:00
|
||||
draft: false
|
||||
snippet_types: ["react", "jsx"]
|
||||
---
|
||||
|
||||
The other day at work we have an html comment in jsx slip on to stage. Made me relize I didn't know how to leave comments in jsx myself.
|
||||
|
||||
So as a reminder **DON'T** do this:
|
||||
|
||||
```jsx
|
||||
<div>
|
||||
<!-- comment here -->
|
||||
<h2>Hello world</h2>
|
||||
</div>
|
||||
```
|
||||
|
||||
**Instead do this:**
|
||||
|
||||
```jsx
|
||||
<div>
|
||||
{/* comment here */}
|
||||
<h2>Hello world</h2>
|
||||
</div>
|
||||
```
|
||||
|
||||
source:
|
||||
|
||||
https://wesbos.com/react-jsx-comments
|
||||
Loading…
Add table
Add a link
Reference in a new issue