0

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

4

1 回答 1

1

将此代码放在全局范围内的某个位置:

__REACT_DEVTOOLS_GLOBAL_HOOK__ = {
  supportsFiber: true,
  inject: function() {},
  onCommitFiberRoot: function() {},
  onCommitFiberUnmount: function() {},
};
于 2017-09-28T00:08:16.990 回答