Skip to content

Commit 958954d

Browse files
bastiendmtljharb
authored andcommitted
[Docs] fix broken links:
- `default-props-match-prop-types` - `jsx-boolean-value` - `jsx-curly-brace-presence` - `jsx-no-bind` - `no-array-index-key` - `no-is-mounted` - `no-render-return-value` - `require-default-props`
1 parent 2c0b10c commit 958954d

9 files changed

+14
-11
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
# Change Log
23

34
All notable changes to this project will be documented in this file.
@@ -12,8 +13,10 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange
1213

1314
### Changed
1415
* [Tests] [`jsx-no-script-url`]: Improve tests ([#3849][] @radu2147)
16+
* [Docs] fix broken links: [`default-props-match-prop-types`], [`jsx-boolean-value`], [`jsx-curly-brace-presence`], [`jsx-no-bind`], [`no-array-index-key`], [`no-is-mounted`], [`no-render-return-value`], [`require-default-props`] ([#3841][] @bastiendmt)
1517

1618
[#3849]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3849
19+
[#3841]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3841
1720
[#3840]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3840
1821
[#3833]: https://github.com/jsx-eslint/eslint-plugin-react/issues/3833
1922

docs/rules/default-props-match-prop-types.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ If you don't care about stray `defaultsProps` in your components, you can disabl
196196

197197
## Resources
198198

199-
- [Official React documentation on defaultProps](https://facebook.github.io/react/docs/typechecking-with-proptypes.html#default-prop-values)
199+
- [Official React documentation on defaultProps](https://legacy.reactjs.org/docs/typechecking-with-proptypes.html#default-prop-values)
200200

201201
[PropTypes]: https://reactjs.org/docs/typechecking-with-proptypes.html
202202
[TypeScript]: https://www.typescriptlang.org/

docs/rules/jsx-boolean-value.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<!-- end auto-generated rule header -->
66

7-
[When using a boolean attribute in JSX](https://facebook.github.io/react/docs/jsx-in-depth.html#boolean-attributes), you can set the attribute value to `true` or omit the value.
7+
When using a [boolean attribute in JSX](https://web.archive.org/web/20160607204033/http://facebook.github.io/react/docs/jsx-in-depth.html#boolean-attributes), you can set the attribute value to `true` or omit the value.
88

99
## Rule Details
1010

docs/rules/jsx-curly-brace-presence.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
This rule allows you to enforce curly braces or disallow unnecessary curly braces in JSX props and/or children.
88

9-
For situations where JSX expressions are unnecessary, please refer to [the React doc](https://facebook.github.io/react/docs/jsx-in-depth.html) and [this page about JSX gotchas](https://github.com/facebook/react/blob/v15.4.0-rc.3/docs/docs/02.3-jsx-gotchas.md#html-entities).
9+
For situations where JSX expressions are unnecessary, please refer to [the React doc](https://legacy.reactjs.org/docs/jsx-in-depth.html) and [this page about JSX gotchas](https://github.com/facebook/react/blob/v15.4.0-rc.3/docs/docs/02.3-jsx-gotchas.md#html-entities).
1010

1111
## Rule Details
1212

docs/rules/jsx-no-bind.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ This will speed up rendering, as it avoids the need to create new functions (thr
153153
154154
### ES6 Classes
155155
156-
Unfortunately [React ES6 classes](https://facebook.github.io/react/blog/2015/01/27/react-v0.13.0-beta-1.html#es6-classes) do not autobind their methods like components created with the older `createReactClass` syntax. There are several approaches to binding methods for ES6 classes. A basic approach is to just manually bind the methods in the constructor:
156+
Unfortunately [React ES6 classes](https://legacy.reactjs.org/blog/2015/01/27/react-v0.13.0-beta-1.html#es6-classes) do not autobind their methods like components created with the older `createReactClass` syntax. There are several approaches to binding methods for ES6 classes. A basic approach is to just manually bind the methods in the constructor:
157157
158158
```jsx
159159
class Foo extends React.Component {
@@ -174,7 +174,7 @@ class Foo extends React.Component {
174174
}
175175
```
176176
177-
A more sophisticated approach would be to use something like an [autobind ES7 decorator](https://www.npmjs.com/package/core-decorators#autobind) or [property initializers](https://facebook.github.io/react/blog/2015/01/27/react-v0.13.0-beta-1.html#autobinding).
177+
A more sophisticated approach would be to use something like an [autobind ES7 decorator](https://www.npmjs.com/package/core-decorators#autobind) or [property initializers](https://legacy.reactjs.org/blog/2015/01/27/react-v0.13.0-beta-1.html#autobinding).
178178
179179
### React Hooks
180180
@@ -191,7 +191,7 @@ const Button = () => {
191191
};
192192
```
193193
194-
Otherwise, the idiomatic way to avoid redefining callbacks on every render would be to memoize them using the [`useCallback`](https://reactjs.org/docs/hooks-reference.html#usecallback) hook:
194+
Otherwise, the idiomatic way to avoid redefining callbacks on every render would be to memoize them using the [`useCallback`](https://legacy.reactjs.org/docs/hooks-reference.html#usecallback) hook:
195195
196196
```jsx
197197
const Button = () => {

docs/rules/no-array-index-key.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
Warn if an element uses an Array index in its `key`.
66

7-
The `key` is used by React to [identify which items have changed, are added, or are removed and should be stable](https://facebook.github.io/react/docs/lists-and-keys.html#keys).
7+
The `key` is used by React to [identify which items have changed, are added, or are removed and should be stable](https://react.dev/learn/rendering-lists#why-does-react-need-keys).
88

99
It's a bad idea to use the array index since it doesn't uniquely identify your elements. In cases where the array is sorted or an element is added to the beginning of the array, the index will be changed even though the element representing that index may be the same. This results in unnecessary renders.
1010

docs/rules/no-is-mounted.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
[`isMounted` is an anti-pattern][anti-pattern], is not available when using ES6 classes, and it is on its way to being officially deprecated.
88

9-
[anti-pattern]: https://facebook.github.io/react/blog/2015/12/16/ismounted-antipattern.html
9+
[anti-pattern]: https://legacy.reactjs.org/blog/2015/12/16/ismounted-antipattern.html
1010

1111
## Rule Details
1212

docs/rules/no-render-return-value.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
<!-- end auto-generated rule header -->
66

7-
> `ReactDOM.render()` currently returns a reference to the root `ReactComponent` instance. However, using this return value is legacy and should be avoided because future versions of React may render components asynchronously in some cases. If you need a reference to the root `ReactComponent` instance, the preferred solution is to attach a [callback ref](https://reactjs.org/docs/refs-and-the-dom.html#callback-refs) to the root element.
7+
> `ReactDOM.render()` currently returns a reference to the root `ReactComponent` instance. However, using this return value is legacy and should be avoided because future versions of React may render components asynchronously in some cases. If you need a reference to the root `ReactComponent` instance, the preferred solution is to attach a [callback ref](https://legacy.reactjs.org/docs/refs-and-the-dom.html#callback-refs) to the root element.
88
9-
Source: [ReactDOM documentation](https://facebook.github.io/react/docs/react-dom.html#render)
9+
Source: [ReactDOM documentation](https://legacy.reactjs.org/docs/react-dom.html#render)
1010

1111
## Rule Details
1212

docs/rules/require-default-props.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ If you don't care about using `defaultProps` for your component's props that are
476476

477477
## Resources
478478

479-
- [Official React documentation on defaultProps](https://facebook.github.io/react/docs/typechecking-with-proptypes.html#default-prop-values)
479+
- [Official React documentation on defaultProps](https://legacy.reactjs.org/docs/typechecking-with-proptypes.html#default-prop-values)
480480

481481
[PropTypes]: https://reactjs.org/docs/typechecking-with-proptypes.html
482482
[TypeScript]: https://www.typescriptlang.org/

0 commit comments

Comments
 (0)