0
在我的原生反應項目中,我收到以下警告。反應本機警告 - 例如「PropTypes已被移動到一個單獨的包」
Warning: PropTypes has been moved to a separate package. Accessing React.PropTypes is no longer supported and will be removed completely in React 16. Use the prop-types package on npm instead.
Warning: React.createClass is no longer supported. Use a plain JavaScript class instead. If you're not yet ready to migrate, create-react-class is available on npm as a drop-in replacement.
Warning: View.propTypes has been deprecated and will be removed in a future version of ReactNative. Use ViewPropTypes instead.
不過,我敢肯定,我還沒有在我的項目做到了這一點,並已經做了全局搜索,好像它們的實例是節點模塊文件夾中,特別是在模塊,我沒有安裝我自己。我應該如何繼續?我試圖按照文檔中的建議重新構建以下命令。
jscodeshift -t react-codemod/transforms/React-PropTypes-to-prop-types.js <path>
當我嘗試它時,幾個節點模塊損壞,應用程序無法編譯。之後我不得不重新安裝npm模塊,所以我沒有取得任何進展。
有什麼方法可以準確找出這些警告發生的位置嗎?我已經完成了全球搜索,但仍不清楚該警告指的是什麼文件。 –
當第三方dep不兼容時,你很不走運。讓他們更新。如果一個dep ...的瞬時dep可能是切換的時間。一段時間以來沒有被觸及的很多靜重。警告只針對'env ='development'',所以它不會影響你的構建。此外,反應原生16將仍然有一段時間。 –
@DimitarChristoff謝謝! –