Browse Source

Tweak deprecation messages to be less scary (#10145)

main
Dan Abramov 7 years ago
committed by GitHub
parent
commit
839d701840
  1. 9
      docs/addons.md
  2. 7
      docs/context.md
  3. 5
      docs/typechecking-with-proptypes.md
  4. 5
      warnings/dont-call-proptypes.md

9
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

7
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.

5
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:

5
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.

Loading…
Cancel
Save