Skip to content

Commit 2e2f503

Browse files
authored
Tweak deprecation messages to be less scary (facebook#10145)
1 parent b79619e commit 2e2f503

File tree

4 files changed

+18
-8
lines changed

4 files changed

+18
-8
lines changed

docs/docs/addons.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ title: Add-Ons
44
permalink: docs/addons.html
55
---
66

7-
>Note:
8-
> `React.addons` is deprecated as of React v15.5. The add-ons have now all either been deprecated or moved to separate modules.
7+
> Note:
8+
>
9+
> `React.addons` entry point is deprecated as of React v15.5. The add-ons have moved to separate modules, and some of them have been deprecated.
910

1011
The React add-ons are a collection of useful utility modules for building React apps. **These should be considered experimental** and tend to change more often than the core.
1112

@@ -18,7 +19,7 @@ The add-ons below are in the development (unminified) version of React only:
1819

1920
### Legacy Add-ons
2021

21-
The add-ons below are considered legacy and their use is discouraged.
22+
The add-ons below are considered legacy and their use is discouraged. They will keep working in observable future, but there is no further development.
2223

2324
- [`PureRenderMixin`](pure-render-mixin.html). Use [`React.PureComponent`](/react/docs/react-api.html#react.purecomponent) instead.
2425
- [`shallowCompare`](shallow-compare.html), a helper function that performs a shallow comparison for props and state in a component to decide if a component should update.
@@ -28,7 +29,7 @@ The add-ons below are considered legacy and their use is discouraged.
2829
### Deprecated Add-ons
2930

3031
- [`LinkedStateMixin`](two-way-binding-helpers.html) has been deprecated.
31-
- [`TransitionGroup` and `CSSTransitionGroup`](animation.html) have been deprecated.
32+
- [`TransitionGroup` and `CSSTransitionGroup`](animation.html) have been deprecated in favor of [their drop-in replacements](https://github.com/reactjs/react-transition-group/tree/v1-stable).
3233

3334
## Using React with Add-ons
3435

docs/docs/context.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@ title: Context
44
permalink: docs/context.html
55
---
66

7-
>Note:
8-
> As of React v15.5 the `React.PropTypes` helper is deprecated, and we recommend using the [`prop-types` library](https://www.npmjs.com/package/prop-types) to define `contextTypes`.
7+
> Note:
8+
>
9+
> `React.PropTypes` has moved into a different package since React v15.5. Please use [the `prop-types` library instead](https://www.npmjs.com/package/prop-types) to define `contextTypes`.
10+
>
11+
>We provide [a codemod script](/react/blog/2017/04/07/react-v15.5.0.html#migrating-from-react.proptypes) to automate the conversion.
912

1013
With React, it's easy to track the flow of data through your React components. When you look at a component, you can see which props are being passed, which makes your apps easy to reason about.
1114

docs/docs/typechecking-with-proptypes.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ redirect_from:
77
---
88

99
> Note:
10-
> `React.PropTypes` is deprecated as of React v15.5. Please use [the `prop-types` library instead](https://www.npmjs.com/package/prop-types).
10+
>
11+
> `React.PropTypes` has moved into a different package since React v15.5. Please use [the `prop-types` library instead](https://www.npmjs.com/package/prop-types).
12+
>
13+
>We provide [a codemod script](/react/blog/2017/04/07/react-v15.5.0.html#migrating-from-react.proptypes) to automate the conversion.
1114

1215
As your app grows, you can catch a lot of bugs with typechecking. For some applications, you can use JavaScript extensions like [Flow](https://flowtype.org/) or [TypeScript](https://www.typescriptlang.org/) to typecheck your whole application. But even if you don't use those, React has some built-in typechecking abilities. To run typechecking on the props for a component, you can assign the special `propTypes` property:
1316

docs/warnings/dont-call-proptypes.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ permalink: warnings/dont-call-proptypes.html
55
---
66

77
> Note:
8-
> `React.PropTypes` is deprecated as of React v15.5. Please use [the `prop-types` library instead](https://github.com/reactjs/prop-types).
8+
>
9+
> `React.PropTypes` has moved into a different package since React v15.5. Please use [the `prop-types` library instead](https://www.npmjs.com/package/prop-types).
10+
>
11+
>We provide [a codemod script](/react/blog/2017/04/07/react-v15.5.0.html#migrating-from-react.proptypes) to automate the conversion.
912

1013
In a future major release of React, the code that implements PropType validation functions will be stripped in production. Once this happens, any code that calls these functions manually (that isn't stripped in production) will throw an error.
1114

0 commit comments

Comments
 (0)