如何在React 16中禁用/隐藏React DevTools控制台警告:
Warning: The installed version of React DevTools is too old and will not work with the current version of React. Please update React DevTools.
答案 0 :(得分:1)
将此代码放在全局范围内:
__REACT_DEVTOOLS_GLOBAL_HOOK__ = {
supportsFiber: true,
inject: function() {},
onCommitFiberRoot: function() {},
onCommitFiberUnmount: function() {},
};