hybrid-navigation 3.0.8 → 3.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/hooks.js CHANGED
@@ -9,6 +9,9 @@ export function useVisibleEffect(callback) {
9
9
  const event = useEffectEvent(callback);
10
10
  useEffect(() => {
11
11
  let destructor;
12
+ if (navigator.visibility === 'visible') {
13
+ destructor = event();
14
+ }
12
15
  const subscription = Navigation.addVisibilityEventListener(navigator.sceneId, v => {
13
16
  if (v === 'visible') {
14
17
  destructor = event();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "hybrid-navigation",
3
3
  "description": "React Native Navigation that supports seamless navigation between Native and React.",
4
- "version": "3.0.8",
4
+ "version": "3.0.9",
5
5
  "main": "./dist/index",
6
6
  "module": "./dist/index",
7
7
  "types": "./dist/index.d.ts",
package/src/hooks.ts CHANGED
@@ -12,6 +12,9 @@ export function useVisibleEffect<T extends Function>(callback: T) {
12
12
 
13
13
  useEffect(() => {
14
14
  let destructor: (() => void) | undefined;
15
+ if (navigator.visibility === 'visible') {
16
+ destructor = event();
17
+ }
15
18
  const subscription = Navigation.addVisibilityEventListener(navigator.sceneId, v => {
16
19
  if (v === 'visible') {
17
20
  destructor = event();