Pankaj Bhardwaj
Pankaj Bhardwaj

Reputation: 2131

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

I am facing this warning in my react Native App, How to solve this any suggestion would be helpful.

Upvotes: 3

Views: 2040

Answers (2)

Jaybo
Jaybo

Reputation: 954

I had the same problem with my existing native app. I followed the Integrating with Existing Apps guide and solved it.

Simply change Podfile

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

to

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

Upvotes: 7

designorant
designorant

Reputation: 2401

I guess the ideal way is to refactor the module that uses RCTBatchedBridge to avoid the warning, but if this is out of your control you can hide the it with console.ignoredYellowBox:

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

You can read more about it at: https://facebook.github.io/react-native/docs/debugging.html#warnings

Upvotes: 1

Related Questions