ReactJS:如何找到仍然通过主反应包使用 PropTypes 的依赖项
ReactJS: How to find dependencies, which still use PropTypes via main react package
我已经将我的 React 应用程序(基于 meteorJS)更改为 prop-types
包,但我仍然收到警告 Warning: Accessing PropTypes via the main React package is deprecated. Use the prop-types package from npm instead.
所以我认为有任何依赖仍在使用 'old' 样式。但是如何找到这种依赖关系?
这是控制台给我的:
modules.js?hash=49c6db2db08899db6ed5ab18f5681ac3bb3d8eab:13361 Warning: Accessing PropTypes via the main React package is deprecated. Use the prop-types package from npm instead.
printWarning @ modules.js?hash=49c6db2db08899db6ed5ab18f5681ac3bb3d8eab:13361
warning @ modules.js?hash=49c6db2db08899db6ed5ab18f5681ac3bb3d8eab:13385
get @ modules.js?hash=49c6db2db08899db6ed5ab18f5681ac3bb3d8eab:9932
PropTypes.js @ modules.js?hash=49c6db2db08899db6ed5ab18f5681ac3bb3d8eab:32612
fileEvaluate @ modules-runtime.js?hash=8587d188e038b75ecd27ed2469a52b269e38fb62:343
require @ modules-runtime.js?hash=8587d188e038b75ecd27ed2469a52b269e38fb62:238
index.js @ modules.js?hash=49c6db2db08899db6ed5ab18f5681ac3bb3d8eab:32381
fileEvaluate @ modules-runtime.js?hash=8587d188e038b75ecd27ed2469a52b269e38fb62:343
require @ modules-runtime.js?hash=8587d188e038b75ecd27ed2469a52b269e38fb62:238
main.js @ main.js:1
fileEvaluate @ modules-runtime.js?hash=8587d188e038b75ecd27ed2469a52b269e38fb62:343
require @ modules-runtime.js?hash=8587d188e038b75ecd27ed2469a52b269e38fb62:238
(anonymous) @ app.js?hash=bbc39e8f76f81774071d5c0341cfd78e2baf4ccc:25882
我在目录 'node_modules' 上使用简单文本搜索来搜索可能具有从 'react';
导入 PropTypes 的旧样式的行
grep -R "PropTypes.*'react" node_modules/
然后使用该工具,从 grep 输出中找到导致警告消息的项目。
我已经将我的 React 应用程序(基于 meteorJS)更改为 prop-types
包,但我仍然收到警告 Warning: Accessing PropTypes via the main React package is deprecated. Use the prop-types package from npm instead.
所以我认为有任何依赖仍在使用 'old' 样式。但是如何找到这种依赖关系?
这是控制台给我的:
modules.js?hash=49c6db2db08899db6ed5ab18f5681ac3bb3d8eab:13361 Warning: Accessing PropTypes via the main React package is deprecated. Use the prop-types package from npm instead.
printWarning @ modules.js?hash=49c6db2db08899db6ed5ab18f5681ac3bb3d8eab:13361
warning @ modules.js?hash=49c6db2db08899db6ed5ab18f5681ac3bb3d8eab:13385
get @ modules.js?hash=49c6db2db08899db6ed5ab18f5681ac3bb3d8eab:9932
PropTypes.js @ modules.js?hash=49c6db2db08899db6ed5ab18f5681ac3bb3d8eab:32612
fileEvaluate @ modules-runtime.js?hash=8587d188e038b75ecd27ed2469a52b269e38fb62:343
require @ modules-runtime.js?hash=8587d188e038b75ecd27ed2469a52b269e38fb62:238
index.js @ modules.js?hash=49c6db2db08899db6ed5ab18f5681ac3bb3d8eab:32381
fileEvaluate @ modules-runtime.js?hash=8587d188e038b75ecd27ed2469a52b269e38fb62:343
require @ modules-runtime.js?hash=8587d188e038b75ecd27ed2469a52b269e38fb62:238
main.js @ main.js:1
fileEvaluate @ modules-runtime.js?hash=8587d188e038b75ecd27ed2469a52b269e38fb62:343
require @ modules-runtime.js?hash=8587d188e038b75ecd27ed2469a52b269e38fb62:238
(anonymous) @ app.js?hash=bbc39e8f76f81774071d5c0341cfd78e2baf4ccc:25882
我在目录 'node_modules' 上使用简单文本搜索来搜索可能具有从 'react';
导入 PropTypes 的旧样式的行grep -R "PropTypes.*'react" node_modules/
然后使用该工具,从 grep 输出中找到导致警告消息的项目。