Skip to content

bamlab/react-navigation-live-reload-on-screen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

react-navigation-live-reload-on-screen

Based on this, stay on current screen when you live reload. This works by storing the navigation state in the async storage and getting it back when reloading.

Install

yarn add @bam.tech/react-navigation-live-reload-on-screen

Usage

import { NavigationContainer as ReactNavigationContainer } from "@react-navigation/native";
import { enableLiveReloadOnScreen } from "@bam.tech/react-navigation-live-reload-on-screen";

const ENABLE_LIVE_RELOAD = __DEV__;
const ENABLE_LIVE_RELOAD_LOGS = true;
const NavigationContainer = enableLiveReloadOnScreen(ENABLE_LIVE_RELOAD, ENABLE_LIVE_RELOAD_LOGS)(
  ReactNavigationContainer
);

// Use NavigationContainer instead of the one from react-navigation

Clearing navigation state

If you need to clear the persisted navigation state at some point:

import { clearNavigationState } from "@bam.tech/react-navigation-live-reload-on-screen";

clearNavigationState();

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published