我正在显示反应原生闪屏并尝试将其隐藏在 useEffect 中,但如果我在 App.js 中使用 AWS Authenticator,则不会调用 useEffect。当我不使用身份验证器时,它工作正常。
应用程序.js
import Amplify from 'aws-amplify';
import config from './src/aws-exports';
import { withAuthenticator } from 'aws-amplify-react-native';
import Auth from '@aws-amplify/auth';
import SplashScreen from 'react-native-splash-screen';
import { useEffect } from 'react';
function App (){
useEffect(() => {
SplashScreen.hide();
});
return (
<View>
</View>
);
};
export default withAuthenticator(App);
如果我删除最后一行,它可以在没有 Authenticator 的情况下正常工作。