Skip to content

Commit f0474fd

Browse files
authored
Update honest-peas-peel.md
1 parent 943176a commit f0474fd

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

.changeset/honest-peas-peel.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
---
2-
"eslint-plugin-react-server-components": minor
2+
"eslint-plugin-react-server-components": major
33
---
44

5-
Making checks for window usage more robust to not require "use client" when safely accessed behind a `typeof window !== 'undefined'` or `typeof document !== 'undefined'`check.
5+
Makes checks for window usage more robust to not require "use client" when safely accessed behind a `typeof window !== 'undefined'` or `typeof document !== 'undefined'`check.
66

77
For example:
8-
```
9-
const HREF = typeof window !== 'undefined' ? window.location.href : '';
108

11-
const MyComponent = () => {
12-
return <div>{HREF}</div>;
13-
}
9+
```jsx
10+
const href = typeof window !== 'undefined' ? window.location.href : '';
11+
12+
const MyComponent = () => <div>{href}</div>;
1413
```
15-
does not need to be marked with a "use client" because all of it's client only actions are behind a server check.
14+
15+
This does not need to be marked with a "use client" because all of its client-only actions are behind a safety check.

0 commit comments

Comments
 (0)