Skip to content

Deprecation warnings use console.warn instead of console.error #9395

Closed
@bvaughn

Description

@bvaughn

Historically, React has logged warnings to console.error (rather than console.warn). I believe this has been done for a variety of reasons:

  1. Certain types of warnings may indicate a serious problem even if they are not always fatal.
  2. In the past, stack trace was not available with console.warn calls.

Deprecation warnings are intended to provide users a heads-up on features that will be changing/breaking in the next major release. Up until now we have also logged these warnings to console.error. This makes them more noticeable but comes at the cost of:

  1. Potentially over-emphasizing the urgency of addressing them. (eg you should address them before upgrading to the next major, you don't need to address the now).
  2. Potentially causing CI test failures for certain runners that treat unexpected console.error calls as fatal.

After some discussion the React team has decided to replace console.error calls with console.warn for deprecation warnings only. We intend to release this change in the upcoming 15.6 release.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions