react-native-wait-navigation
TypeScript icon, indicating that this package has built-in type declarations

0.2.3 • Public • Published

React Native Wait Navigation

React Native Wait Navigation is an efficient solution to handle the initial navigation in your React Native applications.

Installation

You can install this package using npm or yarn as per your preference.

npm i react-native-wait-navigation
yarn add react-native-wait-navigation

Usage

Start by importing the necessary modules:

import { createRef } from 'react';
import { NavigationContainer, NavigationContainerRef } from '@react-navigation/native';
import { useWaitNavigation } from 'react-native-wait-navigation';

Next, create a reference for the NavigationContainer:

export const navigationRef = createRef<NavigationContainerRef>();

In your App component, use the useWaitNavigation() hook to delay the navigation until certain conditions are met (e.g. closing the SplashScreen, handling deeplinks):

export default function App() {
  useWaitNavigation(navigationRef, () => {
    closeSplashScreen();
  });

  return (
    <NavigationContainer ref={navigationRef}>
        {/* Rest of your app code */}
    </NavigationContainer>
  );
}

By employing this library, you can manage your navigation in the application effectively, ensuring a smoother user experience.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.2.3
    69
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.2.3
    69
  • 0.2.2
    42
  • 0.2.1
    2
  • 0.2.0
    1
  • 0.1.0
    2

Package Sidebar

Install

npm i react-native-wait-navigation

Weekly Downloads

106

Version

0.2.3

License

MIT

Unpacked Size

22.5 kB

Total Files

21

Last publish

Collaborators

  • oktaysenkan