Skip to content

Commit 7bd6175

Browse files
fix: fixed docs whitespaces
1 parent a1e60dc commit 7bd6175

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

docs/rules/ensure-matching-remove-event-listener.md

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,40 +10,32 @@ This rule aims at reminding developers to add the corrisponding removeEventListe
1010

1111
Examples of **incorrect** code for this rule:
1212

13-
```js
14-
13+
```jsx
1514
// Missing a matching removeEventListener.
16-
1715
useEffect(() => {
1816
window.addEventListener("keydown", handleUserKeyPress);
1917
return () => {
2018
doThis();
2119
};
2220
}, [])
23-
2421
```
2522

26-
```js
27-
23+
```jsx
2824
// Missing a cleanup function for the addEventListener.
29-
3025
useEffect(() => {
3126
window.addEventListener("keydown", handleUserKeyPress);
3227
}, [])
33-
3428
```
3529

3630
Examples of **correct** code for this rule:
3731

38-
```js
39-
32+
```jsx
4033
useEffect(() => {
4134
window.addEventListener("keydown", handleUserKeyPress);
4235
return () => {
4336
window.removeEventListener("keydown", handleUserKeyPress);
4437
};
4538
}, []);
46-
4739
```
4840

4941
## When Not To Use It

0 commit comments

Comments
 (0)