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

0.2.0 • Public • Published

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 NavigationContainer = enableLiveReloadOnScreen(ENABLE_LIVE_RELOAD)(
  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();

Package Sidebar

Install

npm i @bam.tech/react-navigation-live-reload-on-screen

Weekly Downloads

56

Version

0.2.0

License

MIT

Unpacked Size

5.36 kB

Total Files

3

Last publish

Collaborators

  • almouro
  • tychota
  • julienc6
  • minishlink
  • marekkalnik
  • laurence923
  • antoined
  • clementtab
  • cyrilbo
  • charlotteisambertbam
  • antoine-cottineau
  • remilry
  • matthieugbam
  • p0labrd
  • alexisd
  • evej
  • matthieug
  • thomasre
  • vicprz
  • robingullo
  • pierpo
  • pierrezimmermann
  • hugok
  • nicodeck44