ReactJS:如何查找依赖项,它仍然通过主反应包使用PropTypes

时间:2017-06-09 07:45:11

标签: reactjs npm dependencies react-proptypes

我已将我的反应应用程序(基于meteorJS)更改为prop-types包,但我仍然收到警告Warning: Accessing PropTypes via the main React package is deprecated. Use the prop-types package from npm instead.

所以我认为还有任何依赖仍然使用'旧'风格。但是我如何找到这种依赖?

这是控制台给我的:

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

1 个答案:

答案 0 :(得分:1)

我在目录&#node.dmodules'上使用了简单的文本搜索。搜索可能具有旧样式导入PropTypes的行' react';

grep -R "PropTypes.*'react" node_modules/

使用该工具,找到导致grep输出发出警告消息的项目。