# react-native-wait-navigation

> React Native navigation initialization handler

Latest version **0.2.3** (published 2024-09-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-native-wait-navigation
pnpm add react-native-wait-navigation
yarn add react-native-wait-navigation
bun add react-native-wait-navigation
```

## Health

**Score 35/100 (D)** — status: maintenance-mode.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.3 |
| Published | 2024-09-18 |
| First published | 2022-03-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=6.0.0 |
| Dependencies | 9 |
| Unpacked size | 22 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 16 |
| Author | Oktay Şenkan |
| Maintainers | oktaysenkan |
| Keywords | react-native, react, react-navigation |

## Links

- npm: https://www.npmjs.com/package/react-native-wait-navigation
- Repository: https://github.com/oktaysenkan/react-native-wait-navigation
- Homepage: https://github.com/oktaysenkan/react-native-wait-navigation#readme
- Issues: https://github.com/oktaysenkan/react-native-wait-navigation/issues
- npm.io page: https://npm.io/package/react-native-wait-navigation

## Dependencies (9)

- [fuuu](https://npm.io/package/fuuu.md) ^0.0.8
- [react-dom](https://npm.io/package/react-dom.md) ^18.3.1
- [eventemitter3](https://npm.io/package/eventemitter3.md) ^4.0.7
- [lodash.camelcase](https://npm.io/package/lodash.camelcase.md) ^4.3.0
- [rollup-plugin-json](https://npm.io/package/rollup-plugin-json.md) ^4.0.0
- [rollup-plugin-commonjs](https://npm.io/package/rollup-plugin-commonjs.md) ^10.1.0
- [rollup-plugin-sourcemaps](https://npm.io/package/rollup-plugin-sourcemaps.md) ^0.6.3
- [rollup-plugin-typescript2](https://npm.io/package/rollup-plugin-typescript2.md) ^0.36.0
- [rollup-plugin-node-resolve](https://npm.io/package/rollup-plugin-node-resolve.md) ^5.2.0

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.2.3 (latest) — 2024-09-18
- 0.2.2 — 2022-06-27
- 0.2.1 — 2022-03-31
- 0.2.0 — 2022-03-26
- 0.1.0 — 2022-03-26

## README

# 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. 

```bash
npm i react-native-wait-navigation
```

```bash
yarn add react-native-wait-navigation
```

## Usage

Start by importing the necessary modules:

```jsx
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:

```jsx
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):

```jsx
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.

---
_Source: https://npm.io/package/react-native-wait-navigation · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
