React native TypeError:TypeError:undefined不是一个对象(正在计算此项。_setComponentRef.bind';)

React native TypeError:TypeError:undefined不是一个对象(正在计算此项。_setComponentRef.bind';),react-native,expo,React Native,Expo,每次尝试运行项目时,我都会遇到这个错误。我尝试了许多其他解决方案/修复,但没有成功 这太奇怪了,因为我没有在项目上更新/安装任何新的依赖项。我只记得昨天重启了我的机器,然后就发生了。我觉得这和巴贝尔有关 上次我做这件事时,没有出现错误。但当我试图继续上个星期结束的工作时,它只是显示了这个红色屏幕。我已重置缓存,删除节点_模块,重新安装npm,重新启动笔记本电脑。但是仍然有同样的错误 TypeError: TypeError: undefined is not an object (evaluat

每次尝试运行项目时,我都会遇到这个错误。我尝试了许多其他解决方案/修复,但没有成功

这太奇怪了,因为我没有在项目上更新/安装任何新的依赖项。我只记得昨天重启了我的机器,然后就发生了。我觉得这和巴贝尔有关

上次我做这件事时,没有出现错误。但当我试图继续上个星期结束的工作时,它只是显示了这个红色屏幕。我已重置缓存,删除节点_模块,重新安装npm,重新启动笔记本电脑。但是仍然有同样的错误

TypeError: TypeError: undefined is not an object (evaluating '_this._setComponentRef.bind')

This error is located at:
in AnimatedComponent (at TouchableOpacity.js:256)
in TouchableOpacity (at LogIn.js:236)
in RCTView (at View.js:44)
in RCTView (at View.js:44)
in RCTView (at View.js:44)
in RCTScrollView (at ScrollView.js:977)
in ScrollView (at LogIn.js:126)
in LoginScreen (created by inject-LoginScreen-with-userProfile)
in inject-LoginScreen-with-userProfile (created by SceneView)
in SceneView (created by SwitchView)
in SwitchView (created by Navigator)
in Navigator (at createAppContainer.js:388)
in NavigationContainer (at Authentication.js:22)
in Authentication (at Router/index.js:41)
in Routes (created by inject-Routes-with-userProfile)
in inject-Routes-with-userProfile (at App.js:72)
in Provider (at App.js:71)
in App (at registerRootComponent.js:17)
in RootErrorBoundary (at registerRootComponent.js:16)
in ExpoRootComponent (at renderApplication.js:34)
in RCTView (at View.js:44)
in RCTView (at View.js:44)
in AppContainer (at renderApplication.js:33)
app.json:

{
"name": "flo",
"main": "node_modules/expo/AppEntry.js",
  "private": true,
  "scripts": {
  "start": "expo start",
  "android": "expo start --android",
  "ios": "expo start --ios",
  "eject": "expo eject"
},
"dependencies": {
"@babel/plugin-proposal-decorators": "^7.3.0",
"@mindinventory/react-native-tab-bar-interaction":"github:mindinventory/react-native-tab-bar-interaction",
"axios": "^0.18.0",
"expo": "^31.0.6",
"firebase": "^5.8.5",
"react": "16.5.0",
"react-native": "https://github.com/expo/react-native/archive/sdk-31.0.0.tar.gz",
"react-native-actionsheet": "^2.4.2",
"react-native-app-intro-slider": "^1.0.1",
"react-native-carousel-control": "^2.0.1",
"react-native-dash": "0.0.9",
"react-native-easy-grid": "^0.2.1",
"react-native-firebase": "^5.2.3",
"react-native-google-places-autocomplete": "^1.3.9",
"react-native-modal-datetime-picker": "^6.0.0",
"react-native-motion": "^0.2.0",
"react-native-router-flux": "^4.0.5",
"react-native-sideswipe": "^1.4.2",
"react-native-snap-carousel": "^3.7.5",
"react-navigation": "^3.3.2",
"react-navigation-redux-helpers": "^3.0.0",
"react-redux": "^6.0.1",
"redux": "^4.0.1",
"redux-axios-middleware": "^4.0.0"
},
"devDependencies": {
"@babel/plugin-proposal-class-properties": "^7.3.4",
"babel-preset-expo": "^5.0.0",
"jest-expo": "^32.0.0",
"mobx": "^5.9.0",
"mobx-react": "^5.4.3",
"mobx-state-tree": "^3.10.2",
"schedule": "^0.4.0"
} }

babel.config

module.exports = function(api) {
api.cache(true);
  return {
    presets: ['babel-preset-expo'],
    plugins: [
  ["@babel/plugin-proposal-decorators", { "legacy": true }],
  ["@babel/plugin-proposal-class-properties", { "loose": true }]
    ]
  };
};

你知道怎么让它再次运行吗?为什么会发生这种情况?

请尝试将
@babel/transform flow strip types
插件添加到您的babel配置中。flow strip types插件必须位于类属性之前。如果您不这样做,将会有一个失败的测试用例

"plugins": [
    [
      "@babel/plugin-transform-flow-strip-types"
    ],
    [
      "@babel/plugin-proposal-decorators",
      {
        "legacy": true
      }
    ],
    [
      "@babel/plugin-proposal-class-properties",
      {
        "loose": true
      }
    ]
  ]

请为
AnimatedComponent
Hi@FedeSc发布代码,我很抱歉,因为我不知道这是从哪里来的。我没有任何
动画组件
。请添加代码示例。否则很难得到帮助。添加与
\u setComponentRef
相关的代码。hi@EdisonD'souza我已经用一些细节更新了我的问题(app.json&babel.config)。我正在使用mobX语法装饰器,我觉得这是问题的原因。请尝试将
@babel/transform flow strip types
插件添加到您的babel配置中。