簡體   English   中英

RCTBatchedBridge已棄用,將在未來的React Native版本中刪除

[英]RCTBatchedBridge is deprecated and will be removed in a future React Native release

我在我的反應Native App中面臨這個警告,如何解決這個問題任何建議都會有所幫助。

我的現有原生應用程序遇到了同樣的問題。 我按照“ 與現有應用程序集成”指南進行了解決。

只需更改Podfile

target 'MyApp' do
  pod 'React', :path => '../node_modules/react-native', :subspecs => [
    ...
    'BatchedBridge'
  ]
end

target 'MyApp' do
  pod 'React', :path => '../node_modules/react-native', :subspecs => [
    ...
    'CxxBridge'
  ]

  # Third party deps podspec link
  pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
  pod 'GLog', :podspec => '../node_modules/react-native/third-party-podspecs/GLog.podspec'
  pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
end

我想理想的方法是重構使用RCTBatchedBridge的模塊以避免警告,但是如果這不受你的控制,你可以使用console.ignoredYellowBox隱藏它:

console.ignoredYellowBox = ["RCTBatchedBridge is deprecated and will be removed in a future React Native release."];

您可以在以下網址閱讀更多相關信息: https//facebook.github.io/react-native/docs/debugging.html#warnings

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM