My rep is not high enough to comment on @fly's excellent answer, so I'll C+P it to add this instead:
For anyone looking for a temporary but quick and effective workaround for disabling console warnings from DevTools, this might do the trick.
Disclaimer - this might not work on versions that are not mine(react-scripts v3.0.1, react-dev-utils@^9.0.1), so use it at your own risk.
node_modules/react-dev-utils/webpackHotDevClient.js
- look for this function(should be around line 114)
function handleWarnings(warnings) {
either add the return
at the start of function printWarnings()
(line 124), or comment out the call to printWarnings()
in line 145.
restart, eg with npm run start
, for change to take effect.
This way, the hot reloader continues to work, but the annoying warnings which have already been caught in my editor are not output in the browser.