Home > OS >  React native android splash screen time issue
React native android splash screen time issue

Time:01-25

How can we control the time of splash screen in react native app.? Now it takes over 4 second.

CodePudding user response:

We can use third party libraries to handle splash screen duration. It would be a one time configuration which includes a bit of native changes on both sides. You can use below libraries :-

https://www.npmjs.com/package/react-native-splash-screen (For normal splash) https://www.npmjs.com/package/react-native-lottie-splash-screen (For animated splash using lotties)

CodePudding user response:

I have Used This Library im using Immidiate Hide Splash after budle complete

first See the Documentation

How to Setup SplashScreen see-Video SplashScreen

Use It Like:

import React, {useEffect} from 'react';
import {
  requestUserPermission,
  NotificationListner,
} from './utils/noteficationService';
import {Provider} from 'react-redux';
import {persistor, store} from './redux toolkit/store';
// SCREENS
import Routes from './navigation';
import {PersistGate} from 'redux-persist/integration/react';
//bootsplash
import RNBootSplash from 'react-native-bootsplash';
import {StatusBar, Text, View} from 'react-native';
import CustButton from './constants/gradiantbutton';
export default function App() {
  useEffect(() => {
    requestUserPermission();
    NotificationListner();
    RNBootSplash.hide(); //immidiate
  }, []);

  return (
    <Provider store={store}>
      <PersistGate persistor={persistor}>
        <Routes />
      </PersistGate>
    </Provider>
  );
}

  • Related