简体   繁体   English

TypeError:undefined 不是本机反应中的对象(正在评估“_reactNative.Stylesheet.create”)

[英]TypeError: undefined is not an object (evaluating '_reactNative.Stylesheet.create') in react native

I am making a project in react native and I have installed all the dependencies for it but when I run the code it shows我正在用 React Native 制作一个项目,并且已经为它安装了所有依赖项,但是当我运行它显示的代码时

TypeError: undefined is not an object (evaluating '_reactNative.Stylesheet.create')

along with this underneath连同下面这个

  • node_modules/react-native/Libraries/LogBox/LogBox.js:148:8 in registerError node_modules/react-native/Libraries/LogBox/LogBox.js:148:8 in registerError

  • node_modules/react-native/Libraries/LogBox/LogBox.js:59:8 in errorImpl node_modules/react-native/Libraries/LogBox/LogBox.js:59:8 in errorImpl

  • node_modules/react-native/Libraries/LogBox/LogBox.js:33:4 in console.error node_modules/react-native/Libraries/LogBox/LogBox.js:33:4 in console.error

  • node_modules/expo/build/environment/react-native-logs.fx.js:27:4 in error node_modules/expo/build/environment/react-native-logs.fx.js:27:4 错误

  • node_modules/react-native/Libraries/Core/ExceptionsManager.js:104:6 in reportException node_modules/react-native/Libraries/Core/ExceptionsManager.js:104:6 in reportException

  • node_modules/react-native/Libraries/Core/ExceptionsManager.js:171:19 in handleException node_modules/react-native/Libraries/Core/ExceptionsManager.js:171:19 in handleException

  • node_modules/react-native/Libraries/Core/setUpErrorHandling.js:24:6 in handleError node_modules/react-native/Libraries/Core/setUpErrorHandling.js:24:6 in handleError

  • node_modules/expo-error-recovery/build/ErrorRecovery.fx.js:9:32 in ErrorUtils.setGlobalHandler$argument_0 node_modules/expo-error-recovery/build/ErrorRecovery.fx.js:9:32 在 ErrorUtils.setGlobalHandler$argument_0

  • node_modules/regenerator-runtime/runtime.js:63:36 in tryCatch node_modules/regenerator-runtime/runtime.js:63:36 在 tryCatch

  • node_modules/regenerator-runtime/runtime.js:293:29 in invoke node_modules/regenerator-runtime/runtime.js:293:29 invoke

  • node_modules/regenerator-runtime/runtime.js:63:36 in tryCatch node_modules/regenerator-runtime/runtime.js:63:36 在 tryCatch

  • node_modules/regenerator-runtime/runtime.js:154:27 in invoke node_modules/regenerator-runtime/runtime.js:154:27 invoke

  • node_modules/regenerator-runtime/runtime.js:164:18 in PromiseImpl.resolve.then$argument_0 node_modules/regenerator-runtime/runtime.js:164:18 in PromiseImpl.resolve.then$argument_0

  • node_modules/react-native/node_modules/promise/setimmediate/core.js:37:13 in tryCallOne node_modules/react-native/node_modules/promise/setimmediate/core.js:37:13 在 tryCallOne

  • node_modules/react-native/node_modules/promise/setimmediate/core.js:123:24 in setImmediate$argument_0 node_modules/react-native/node_modules/promise/setimmediate/core.js:123:24 in setImmediate$argument_0

  • node_modules/react-native/Libraries/Core/Timers/JSTimers.js:130:14 in _callTimer node_modules/react-native/Libraries/Core/Timers/JSTimers.js:130:14 in _callTimer

  • node_modules/react-native/Libraries/Core/Timers/JSTimers.js:181:14 in _callImmediatesPass node_modules/react-native/Libraries/Core/Timers/JSTimers.js:181:14 in _callImmediatesPass

  • node_modules/react-native/Libraries/Core/Timers/JSTimers.js:441:30 in callImmediates node_modules/react-native/Libraries/Core/Timers/JSTimers.js:441:30 in callImmediates

  • node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:387:6 in __callImmediates node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:387:6 in __callImmediates

  • node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:135:6 in __guard$argument_0 node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:135:6 in __guard$argument_0

  • node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:364:10 in __guard __guard 中的 node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:364:10

  • node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:134:4 in flushedQueue node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:134:4 influshedQueue

  • [native code]:null in flushedQueue [本机代码]:flushedQueue 中的 null
  • [native code]:null in invokeCallbackAndReturnFlushedQueue [本机代码]:invokeCallbackAndReturnFlushedQueue 中的 null

at first it said something about one of the functions which I fixed but I don't understand where it is referencing the undefined object, if anyone can find what file or function it is talking about, that would be great.起初它说的是我修复的一个函数,但我不明白它在哪里引用了未定义的对象,如果有人能找到它所谈论的文件或函数,那就太好了。

Please try something like this请尝试这样的事情

const styles = StyleSheet.create({ 
  _container: { 
    flex: 1, 
    backgroundColor: 'blue', 
    alignItems: 'center', 
    justifyContent: 'center' 
  }, 
  get container() { 
    return this._container; 
  }, 
  set container(value) { 
    this._container = value; 
  }, 
});

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 React Native,未定义不是 object(评估 '_reactNative.Image.propTypes.resizeMode') - React Native, undefined is not an object (evaluating ‘_reactNative.Image.propTypes.resizeMode’) TypeError:未定义不是对象(评估style.width)是本机反应 - TypeError: undefined is not an object (evaluating style.width) react native React-Native:TypeError:undefined 不是对象(评估“_this.props.item”) - React-Native: TypeError: undefined is not an object (evaluating '_this.props.item') TypeError:undefined 不是 React Native 中的对象(正在评估“addTodo(title, description).then”) - TypeError: undefined is not an object (evaluating 'addTodo(title, description).then') in React Native React Native TypeError:undefined不是对象(评估'_ref.item') - React Native TypeError: undefined is not an object (evaluating '_ref.item') React Native:TypeError:undefined 不是一个对象(评估'_this.props.data.map') - React Native: TypeError: undefined is not an object (evaluating '_this.props.data.map') React Native TypeError: undefined is not an object ('evalating useFormikContext.errors') - React Native TypeError: undefined is not an object ('evaluating useFormikContext.errors') React Native - TypeError: undefined is not an object(评估'navigation.toggleDrawer') - React Native - TypeError: undefined is not an object (evaluating 'navigation.toggleDrawer') TypeError:undefined不是对象(评估'this.props') - React Native - TypeError: undefined is not an object (evaluating 'this.props') - React Native TypeError: undefined is not an object (evalating '_this.props') in my react native project - TypeError: undefined is not an object (evaluating '_this.props') in my react native project
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM