Skip to content

Commit 1f557cb

Browse files
committed
Formatting fixes display name doc
1 parent 66c8adc commit 1f557cb

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

docs/rules/display-name.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,21 +133,27 @@ module.exports = HelloComponent();
133133
`displayName` allows you to [name your context](https://reactjs.org/docs/context.html#contextdisplayname) object. This name is used in the React dev tools for the context's `Provider` and `Consumer`.
134134
When `true` this rule will warn on context objects without a `displayName`.
135135

136-
## Rule Details
137-
138136
Examples of **incorrect** code for this rule:
139137

140138
```jsx
141139
const Hello = React.createContext();
142140
```
143141

142+
```jsx
143+
const Hello = createContext();
144+
```
145+
144146
Examples of **correct** code for this rule:
145147

146148
```jsx
147149
const Hello = React.createContext();
148150
Hello.displayName = "HelloContext";
149151
```
150152

153+
```jsx
154+
const Hello = createContext();
155+
Hello.displayName = "HelloContext";
156+
```
151157

152158
## About component detection
153159

0 commit comments

Comments
 (0)