From 839d7018404b1c8326e5528c78d413dbcc8d7342 Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Tue, 11 Jul 2017 14:05:27 +0100 Subject: [PATCH] Tweak deprecation messages to be less scary (#10145) --- docs/addons.md | 9 +++++---- docs/context.md | 7 +++++-- docs/typechecking-with-proptypes.md | 5 ++++- warnings/dont-call-proptypes.md | 5 ++++- 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/docs/addons.md b/docs/addons.md index b9575b3f..945d0bc8 100644 --- a/docs/addons.md +++ b/docs/addons.md @@ -4,8 +4,9 @@ title: Add-Ons permalink: docs/addons.html --- ->Note: -> `React.addons` is deprecated as of React v15.5. The add-ons have now all either been deprecated or moved to separate modules. +> Note: +> +> `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. 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. @@ -18,7 +19,7 @@ The add-ons below are in the development (unminified) version of React only: ### Legacy Add-ons -The add-ons below are considered legacy and their use is discouraged. +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. - [`PureRenderMixin`](pure-render-mixin.html). Use [`React.PureComponent`](/react/docs/react-api.html#react.purecomponent) instead. - [`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. ### Deprecated Add-ons - [`LinkedStateMixin`](two-way-binding-helpers.html) has been deprecated. -- [`TransitionGroup` and `CSSTransitionGroup`](animation.html) have been deprecated. +- [`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). ## Using React with Add-ons diff --git a/docs/context.md b/docs/context.md index 718e941a..ed75177a 100644 --- a/docs/context.md +++ b/docs/context.md @@ -4,8 +4,11 @@ title: Context permalink: docs/context.html --- ->Note: -> 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`. +> Note: +> +> `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`. +> +>We provide [a codemod script](/react/blog/2017/04/07/react-v15.5.0.html#migrating-from-react.proptypes) to automate the conversion. 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. diff --git a/docs/typechecking-with-proptypes.md b/docs/typechecking-with-proptypes.md index 85c128d3..2ff09339 100644 --- a/docs/typechecking-with-proptypes.md +++ b/docs/typechecking-with-proptypes.md @@ -7,7 +7,10 @@ redirect_from: --- > Note: -> `React.PropTypes` is deprecated as of React v15.5. Please use [the `prop-types` library instead](https://www.npmjs.com/package/prop-types). +> +> `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). +> +>We provide [a codemod script](/react/blog/2017/04/07/react-v15.5.0.html#migrating-from-react.proptypes) to automate the conversion. 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: diff --git a/warnings/dont-call-proptypes.md b/warnings/dont-call-proptypes.md index 05da5c04..ffc8fcf9 100644 --- a/warnings/dont-call-proptypes.md +++ b/warnings/dont-call-proptypes.md @@ -5,7 +5,10 @@ permalink: warnings/dont-call-proptypes.html --- > Note: -> `React.PropTypes` is deprecated as of React v15.5. Please use [the `prop-types` library instead](https://github.com/reactjs/prop-types). +> +> `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). +> +>We provide [a codemod script](/react/blog/2017/04/07/react-v15.5.0.html#migrating-from-react.proptypes) to automate the conversion. 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.