禁用" React DevTools太旧了#34;警告

时间:2017-09-28 00:08:17

标签: reactjs react-devtools

如何在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.

1 个答案:

答案 0 :(得分:1)

将此代码放在全局范围内:

__REACT_DEVTOOLS_GLOBAL_HOOK__ = {
  supportsFiber: true,
  inject: function() {},
  onCommitFiberRoot: function() {},
  onCommitFiberUnmount: function() {},
};