所以我创建了一个项目,并将组件、资产和配置文件夹从其他笔记本电脑复制到这台笔记本电脑。在这个新项目中,我解决了依赖关系,但我仍然遇到这个错误,找不到任何解决方案。任何帮助将不胜感激。
*
> TypeError: _reactNative.default.create is not a function. (In > '_reactNative.default.create({ > screen: { > flex: 1 > }, > view: { > flex: 1 > } })', '_reactNative.default.create' is undefined) ERROR Invariant Violation: Module AppRegistry is not a registered callable > module (calling runApplication). A frequent cause of the error is that > the application entry file path is incorrect. > This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native.
面临同样的问题。
可能您将样式表导入为:
import StyleSheet from 'react-native';
只需将样式表包裹在 {} 内,如下所示:
import {StyleSheet} from 'react-native';
这对我有用。