Skip to content

Commit 19fc8d9

Browse files
committed
docs: update example component names to 'MyComponent' for consistency
1 parent e7f495e commit 19fc8d9

File tree

60 files changed

+231
-234
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+231
-234
lines changed

website/pages/docs/rules/avoid-shorthand-boolean.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ A **safe** auto-fix is available for this rule.
2929
```tsx
3030
import React from "react";
3131

32-
function Example() {
32+
function MyComponent() {
3333
return <button disabled />;
3434
// ^^^^^^^^
3535
// - Avoid using shorthand syntax for 'disabled' attribute.
@@ -41,7 +41,7 @@ function Example() {
4141
```tsx
4242
import React from "react";
4343

44-
function Example() {
44+
function MyComponent() {
4545
return <button disabled={true} />;
4646
}
4747
```

website/pages/docs/rules/avoid-shorthand-fragment.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Enforces the use of explicit `<Fragment>` or `<React.Fragment>` components inste
2727
```tsx
2828
import React from "react";
2929

30-
function Example() {
30+
function MyComponent() {
3131
return (
3232
<>
3333
<button />
@@ -42,7 +42,7 @@ function Example() {
4242
```tsx
4343
import React, { Fragment } from "react";
4444

45-
function Example() {
45+
function MyComponent() {
4646
return (
4747
<Fragment>
4848
<button />

website/pages/docs/rules/debug-class-component.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Reports all class components. Useful for debugging. This rule should only be use
2929
```tsx
3030
import React from "react";
3131

32-
class Example extends React.Component {
32+
class MyComponent extends React.Component {
3333
render() {
3434
return <button />;
3535
}
@@ -39,7 +39,7 @@ class Example extends React.Component {
3939
```tsx
4040
import React from "react";
4141

42-
class Example extends React.PureComponent {
42+
class MyComponent extends React.PureComponent {
4343
render() {
4444
return <button />;
4545
}

website/pages/docs/rules/debug-function-component.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,27 +29,27 @@ Reports all function components. Useful for debugging. This rule should only be
2929
```tsx
3030
import React from "react";
3131

32-
function Example() {
32+
function MyComponent() {
3333
return <button />;
3434
}
3535
```
3636

3737
```tsx
3838
import React from "react";
3939

40-
const Example = () => <button />;
40+
const MyComponent = () => <button />;
4141
```
4242

4343
```tsx
4444
import React from "react";
4545

46-
const Example = React.memo(() => <button />);
46+
const MyComponent = React.memo(() => <button />);
4747
```
4848

4949
```tsx
5050
import React from "react";
5151

52-
const Example = React.forwardRef(() => <button />);
52+
const MyComponent = React.forwardRef(() => <button />);
5353
```
5454

5555
## Implementation

website/pages/docs/rules/dom-no-dangerously-set-innerhtml-with-children.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ When using `dangerouslySetInnerHTML`, the content of the DOM element is set from
3636
```tsx
3737
import React from "react";
3838

39-
function Example() {
39+
function MyComponent() {
4040
return (
4141
<div dangerouslySetInnerHTML={{ __html: "Hello World" }}>
4242
<p>Goodbye World</p>
@@ -50,7 +50,7 @@ function Example() {
5050
```tsx
5151
import React from "react";
5252

53-
function Example() {
53+
function MyComponent() {
5454
return <div dangerouslySetInnerHTML={{ __html: "Hello World" }} />;
5555
}
5656
```

website/pages/docs/rules/dom-no-dangerously-set-innerhtml.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Read more about using [dangerouslySetInnerHTML](https://react.dev/reference/reac
3434
```tsx
3535
import React from "react";
3636

37-
function Example() {
37+
function MyComponent() {
3838
return <div dangerouslySetInnerHTML={{ __html: "Hello, World!" }} />;
3939
}
4040
```

website/pages/docs/rules/dom-no-missing-button-type.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Allowed button types are: `submit`, `button` or `reset`.
3838
```tsx
3939
import React from "react";
4040

41-
function Example() {
41+
function MyComponent() {
4242
return <button>Click me</button>;
4343
// ^^^^^^^^^^^^^^^^^^^^^^^^^
4444
// - Missing 'type' attribute on button component.
@@ -50,7 +50,7 @@ function Example() {
5050
```tsx
5151
import React from "react";
5252

53-
function Example() {
53+
function MyComponent() {
5454
return <button type="button">Click me</button>;
5555
}
5656
```

website/pages/docs/rules/dom-no-missing-iframe-sandbox.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ This rule checks all React iframe elements and verifies that there is sandbox at
3838
```tsx
3939
import React from "react";
4040

41-
function Example() {
41+
function MyComponent() {
4242
return <iframe src="https://example.com" />;
4343
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4444
// - Missing 'sandbox' attribute on iframe component.
@@ -50,7 +50,7 @@ function Example() {
5050
```tsx
5151
import React from "react";
5252

53-
function Example() {
53+
function MyComponent() {
5454
return <iframe src="https://example.com" sandbox="allow-popups" />;
5555
}
5656
```

website/pages/docs/rules/dom-no-namespace.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Namespaces, such as with `svg:circle` are not supported in React.
3636
```tsx
3737
import React from "react";
3838

39-
function Example() {
39+
function MyComponent() {
4040
return (
4141
<svg:circle
4242
cx="50"
@@ -55,7 +55,7 @@ function Example() {
5555
```tsx
5656
import React from "react";
5757

58-
function Example() {
58+
function MyComponent() {
5959
return <circle cx="50" cy="50" r="40" stroke="black" stroke-width="3" fill="red" />;
6060
}
6161
```

website/pages/docs/rules/dom-no-script-url.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Prevents usage of `javascript:` URLs as the value of certain attributes.
3636
```tsx
3737
import React from "react";
3838

39-
function Example() {
39+
function MyComponent() {
4040
return <a href="javascript:alert('Hello, world!')">Click me</a>;
4141
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4242
// - Using a `javascript:` URL is a security risk and should be avoided.
@@ -48,7 +48,7 @@ function Example() {
4848
```tsx
4949
import React from "react";
5050

51-
function Example() {
51+
function MyComponent() {
5252
return <a href="/some-page">Click me</a>;
5353
}
5454
```

0 commit comments

Comments
 (0)