react: Stop showing warnings as errors.
I can’t debug my own code because of the warnings spam. The warning spam is beyond my control because react router is having conflicts with history that they haven’t resolved. It’s very frustrating to experience this:

without having any recourse short of installing out of date deps. Show warnings as warnings. That’s what console.warning is for.
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Reactions: 29
- Comments: 17 (2 by maintainers)
@Elijen you’re expected to prevent the warnings by fixing your code. If they’re not actionable then that’s a problem with those specific warnings, not warnings in general.
maybe this code snippet would help some of you. I’m using this myself:
I do agree with @Elijen. A warning should be logged via console.warn() rather than console.error(). That would make filtering in dev tools more convenient.
@gaearon This is just an example. I know this error should be fixed by React Bootstrap, but what concerns me is the React behavior where warnings are printed as errors which makes debugging and development hard (can’t filter these out from JS console).
That’s why I think usage of
console.warningshould be considered.I can’t believe it’s 5 years later and this has never been fixed! Why not? Am I missing something?
Agree with this as well. We should all fix and prevent warnings of course, however the argument is a
warningis not anerrorand shouldn’t displayed as such.I agree with @DieserMerlin. These are often errors which I cannot fix or that are unrelated to my assigned tasks in a project. It becomes hard to spot when a real error occurs.
Showing warnings as errors is very unconventional and should at least be configurable.
This is so annoying, why is this still the case? Just print warnings as warnings and errors as errors… 😅
This is especially uncomfortable if the warnings come from a library you depend on (in my case material-ui). In this case you can’t do anything about the actual warning but always think there’s an error in your code as react shows the warnings as errors.
“our warnings are just as important as your errors” - React
Yeah I don’t get it. My QA team isn’t so concerned with whether or not we have a key on an element (although you may argue they should, that’s another conversation), and digging through to find an actual error is time consuming.