Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tweak deprecation messages to be less scary #10145

Merged
merged 1 commit into from
Jul 11, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 5 additions & 4 deletions docs/docs/addons.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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.
Expand All @@ -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

Expand Down
7 changes: 5 additions & 2 deletions docs/docs/context.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
5 changes: 4 additions & 1 deletion docs/docs/typechecking-with-proptypes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
5 changes: 4 additions & 1 deletion docs/warnings/dont-call-proptypes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down