react-native - 如何修复 withAuthenticator(App) 渲染错误
问题描述
我安装了 @react-native-picker/picker 并且我的应用程序中的所有内容都正常运行。当我实现 Auth 并将导出从更改export default App
为export default withAuthenticator(App);
它时,我收到了一个渲染错误,说 Picker 已从反应中删除。无论我是导入 Picker 还是删除 Picker,都会发生这种情况。在此处输入图像描述
import 'react-native-gesture-handler';
import React, {useState} from 'react';
import { StyleSheet, SafeAreaView} from 'react-native';
import Navigation from './src/navigation/index';
import { withAuthenticator } from 'aws-amplify-react-native';
import Amplify from '@aws-amplify/core';
import awsconfig from './src/aws-exports';
Amplify.configure(awsconfig);
const App = () => {
return (
<SafeAreaView style={{flex:1}}>
<Navigation />
</SafeAreaView>
);
};
const styles = StyleSheet.create({
root: {
flex: 1,
},
pageContainer: {
justifyContent: 'center',
alignItems: 'center',
flex: 1,
},
topNavigation: {
flexDirection: 'row',
justifyContent: 'space-around',
width: '100%',
padding: 10,
},
});
export default withAuthenticator(App);
解决方案
推荐阅读
- python - 在 pd.apply() 和 np.vectorize() 中传递函数但不使用更简单的方法时遇到问题?
- ios - 无法将颜色更改为 tabBar?
- macos - 如何更改 Metal 中的 pixelFormat?
- java - 打印循环信息
- azure-information-protection - 使用标签保护文档
- django - Django 限制外键选项
- python - 为什么我们要在 numpy 的 lstsq 函数中打一个?
- java - 我可以将 ViewPager 的滑动方向从 LTR 更改为 RTL 吗?
- angular - 根据屏幕大小移动 ng-content
- python - 如何在列表中存储信息