Skip to content

Commit 436b5f6

Browse files
fixed Linked article on defaultProps docs is paywalled issue
1 parent 59d3c8d commit 436b5f6

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -802,7 +802,7 @@ class Comp extends React.Component<Props, State> {
802802
```tsx
803803
class Comp extends React.Component<
804804
Props,
805-
ReturnType<typeof Comp["getDerivedStateFromProps"]>
805+
ReturnType<(typeof Comp)["getDerivedStateFromProps"]>
806806
> {
807807
static getDerivedStateFromProps(props: Props) {}
808808
}
@@ -1272,7 +1272,7 @@ class Comp extends React.Component<Props, State> {
12721272
```tsx
12731273
class Comp extends React.Component<
12741274
Props,
1275-
ReturnType<typeof Comp["getDerivedStateFromProps"]>
1275+
ReturnType<(typeof Comp)["getDerivedStateFromProps"]>
12761276
> {
12771277
static getDerivedStateFromProps(props: Props) {}
12781278
}
@@ -1360,10 +1360,10 @@ class App extends React.Component<Props, State> {
13601360
Instead of typing the arguments and return values with `React.FormEvent<>` and `void`, you may alternatively apply types to the event handler itself (_contributed by @TomasHubelbauer_):
13611361

13621362
```tsx
1363-
// typing on LEFT hand side of =
1364-
onChange: React.ChangeEventHandler<HTMLInputElement> = (e) => {
1365-
this.setState({text: e.currentTarget.value})
1366-
}
1363+
// typing on LEFT hand side of =
1364+
onChange: React.ChangeEventHandler<HTMLInputElement> = (e) => {
1365+
this.setState({ text: e.currentTarget.value });
1366+
};
13671367
```
13681368

13691369
<details>

docs/basic/getting-started/class-components.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ class Comp extends React.Component<Props, State> {
132132
```tsx
133133
class Comp extends React.Component<
134134
Props,
135-
ReturnType<typeof Comp["getDerivedStateFromProps"]>
135+
ReturnType<(typeof Comp)["getDerivedStateFromProps"]>
136136
> {
137137
static getDerivedStateFromProps(props: Props) {}
138138
}

docs/basic/getting-started/forms-and-events.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ class App extends React.Component<Props, State> {
4545
Instead of typing the arguments and return values with `React.FormEvent<>` and `void`, you may alternatively apply types to the event handler itself (_contributed by @TomasHubelbauer_):
4646

4747
```tsx
48-
// typing on LEFT hand side of =
49-
onChange: React.ChangeEventHandler<HTMLInputElement> = (e) => {
50-
this.setState({text: e.currentTarget.value})
51-
}
48+
// typing on LEFT hand side of =
49+
onChange: React.ChangeEventHandler<HTMLInputElement> = (e) => {
50+
this.setState({ text: e.currentTarget.value });
51+
};
5252
```
5353

5454
<details>

0 commit comments

Comments
 (0)