React Native摇动手势不起作用

Jab*_*Jab 5 react-native

将此pod添加到我的react-native项目(RN 0.42)后,摇动手势在iOS上不再起作用.除了在xcode中构建它之外,我无法调试我的代码,这非常烦人.它确实减慢了开发速度,所以如果有人有解决方案,我们将不胜感激.

source 'https://github.com/CocoaPods/Specs.git'

platform :ios, '8.0'
use_frameworks!

def available_pods
    project ‘rrnf’, 'Debug' => :debug

    react_path = '../node_modules/react-native'
    yoga_path = File.join(react_path, 'ReactCommon/yoga')


    pod 'React', path: react_path, :subspecs => [
    'Core',
    'RCTActionSheet',
    'RCTGeolocation',
    'RCTImage',
    'RCTLinkingIOS',
    'RCTNetwork',
    'RCTSettings',
    'RCTText',
    'RCTVibration',
    'RCTWebSocket',
    ]
    pod 'Yoga', :path => yoga_path

    [
    'Firebase',
    'Firebase/Core',
    'Firebase/Auth',
    'Firebase/Storage',
    'Firebase/Database',
    'Firebase/RemoteConfig',
    'Firebase/Messaging'
    ].each do |lib|
        pod lib
    end

    pod 'react-native-camera', path: '../node_modules/react-native-camera'

end

target 'rrnf' do
    available_pods
end

target 'rrnfTests' do
    available_pods
end
Run Code Online (Sandbox Code Playgroud)

Jab*_*Jab 3

这个 awnser 解决了我的问题 如何将 iOS 摇动手势与 React Native 一起使用?

将 RCT_DEV=0 添加到预处理器宏确实修复了摇动手势。

您可以更改 RCTDefines.h 中的 [RCT_DEV] 值,或者在 React lib 项目的构建设置中,搜索“预处理器宏”并将 RCT_DEV=0 添加到当前定义 DEBUG=1 的部分。