Skip to content

Commit

Permalink
fixed Linked article on defaultProps docs is paywalled issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Nileshshinde09 committed Sep 27, 2024
1 parent 59d3c8d commit 436b5f6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,7 @@ class Comp extends React.Component<Props, State> {
```tsx
class Comp extends React.Component<
Props,
ReturnType<typeof Comp["getDerivedStateFromProps"]>
ReturnType<(typeof Comp)["getDerivedStateFromProps"]>
> {
static getDerivedStateFromProps(props: Props) {}
}
Expand Down Expand Up @@ -1272,7 +1272,7 @@ class Comp extends React.Component<Props, State> {
```tsx
class Comp extends React.Component<
Props,
ReturnType<typeof Comp["getDerivedStateFromProps"]>
ReturnType<(typeof Comp)["getDerivedStateFromProps"]>
> {
static getDerivedStateFromProps(props: Props) {}
}
Expand Down Expand Up @@ -1360,10 +1360,10 @@ class App extends React.Component<Props, State> {
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_):

```tsx
// typing on LEFT hand side of =
onChange: React.ChangeEventHandler<HTMLInputElement> = (e) => {
this.setState({text: e.currentTarget.value})
}
// typing on LEFT hand side of =
onChange: React.ChangeEventHandler<HTMLInputElement> = (e) => {
this.setState({ text: e.currentTarget.value });
};
```

<details>
Expand Down
2 changes: 1 addition & 1 deletion docs/basic/getting-started/class-components.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ class Comp extends React.Component<Props, State> {
```tsx
class Comp extends React.Component<
Props,
ReturnType<typeof Comp["getDerivedStateFromProps"]>
ReturnType<(typeof Comp)["getDerivedStateFromProps"]>
> {
static getDerivedStateFromProps(props: Props) {}
}
Expand Down
8 changes: 4 additions & 4 deletions docs/basic/getting-started/forms-and-events.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ class App extends React.Component<Props, State> {
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_):

```tsx
// typing on LEFT hand side of =
onChange: React.ChangeEventHandler<HTMLInputElement> = (e) => {
this.setState({text: e.currentTarget.value})
}
// typing on LEFT hand side of =
onChange: React.ChangeEventHandler<HTMLInputElement> = (e) => {
this.setState({ text: e.currentTarget.value });
};
```

<details>
Expand Down

0 comments on commit 436b5f6

Please sign in to comment.