Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@cactuslab/native-navigation-react

Package Overview
Dependencies
Maintainers
3
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cactuslab/native-navigation-react - npm Package Compare versions

Comparing version 4.1.0 to 5.0.0

2

dist/esm/context.d.ts

@@ -56,3 +56,3 @@ import type { ClickEventData, DismissOptions, DismissResult, TabUpdate, ViewUpdate } from '@cactuslab/native-navigation';

export declare function NativeNavigationViewContextProvider(props: React.PropsWithChildren<NativeNavigationViewProps>): React.JSX.Element;
export declare function useNativeNavigationViewContext(): NativeNavigationViewContext;
export declare function useNativeNavigationViewContext(options?: ViewUpdate): NativeNavigationViewContext;
export {};

@@ -12,3 +12,4 @@ var __rest = (this && this.__rest) || function (s, e) {

};
import React, { useContext, useMemo } from 'react';
import React, { useContext, useLayoutEffect, useMemo, useRef } from 'react';
import equal from 'fast-deep-equal';
import { useNativeNavigation } from './internal';

@@ -140,5 +141,14 @@ function createViewContext(options) {

}
export function useNativeNavigationViewContext() {
return useContext(Context);
export function useNativeNavigationViewContext(options) {
const context = useContext(Context);
const previousOptions = useRef();
/* We want to update the options before layout occurs */
useLayoutEffect(function () {
if (options && !equal(options, previousOptions.current)) {
previousOptions.current = options;
context.updateView(Object.assign(Object.assign({}, options), { animated: false }));
}
}, [context, options]);
return context;
}
//# sourceMappingURL=context.js.map

@@ -5,2 +5,3 @@ 'use strict';

var React = require('react');
var equal = require('fast-deep-equal');
var reactDom = require('react-dom');

@@ -444,4 +445,13 @@

}
function useNativeNavigationViewContext() {
return React.useContext(Context);
function useNativeNavigationViewContext(options) {
const context = React.useContext(Context);
const previousOptions = React.useRef();
/* We want to update the options before layout occurs */
React.useLayoutEffect(function () {
if (options && !equal(options, previousOptions.current)) {
previousOptions.current = options;
context.updateView(Object.assign(Object.assign({}, options), { animated: false }));
}
}, [context, options]);
return context;
}

@@ -448,0 +458,0 @@

@@ -1,2 +0,2 @@

var CapacitorNativeNavigationReact = (function (exports, nativeNavigation, React, reactDom) {
var CapacitorNativeNavigationReact = (function (exports, nativeNavigation, React, equal, reactDom) {
'use strict';

@@ -440,4 +440,13 @@

}
function useNativeNavigationViewContext() {
return React.useContext(Context);
function useNativeNavigationViewContext(options) {
const context = React.useContext(Context);
const previousOptions = React.useRef();
/* We want to update the options before layout occurs */
React.useLayoutEffect(function () {
if (options && !equal(options, previousOptions.current)) {
previousOptions.current = options;
context.updateView(Object.assign(Object.assign({}, options), { animated: false }));
}
}, [context, options]);
return context;
}

@@ -693,3 +702,3 @@

})({}, CapacitorNativeNavigation, React, ReactDOM);
})({}, CapacitorNativeNavigation, React, equal, ReactDOM);
//# sourceMappingURL=index.js.map
{
"name": "@cactuslab/native-navigation-react",
"version": "4.1.0",
"version": "5.0.0",
"description": "React support for Native navigation for Capacitor apps",

@@ -38,3 +38,3 @@ "main": "dist/plugin.cjs.js",

"devDependencies": {
"@cactuslab/native-navigation": "^0.4.1",
"@cactuslab/native-navigation": "^0.5.0",
"@capacitor/core": "^5.0.3",

@@ -48,3 +48,3 @@ "@types/react": "^18.2.6",

"peerDependencies": {
"@cactuslab/native-navigation": "^0.4.1",
"@cactuslab/native-navigation": "^0.5.0",
"@capacitor/core": "^5.0.3",

@@ -54,2 +54,5 @@ "react": "^18.2.0",

},
"dependencies": {
"fast-deep-equal": "^3.1.3"
},
"scripts": {

@@ -56,0 +59,0 @@ "prettier": "prettier \"**/*.{css,html,ts,js,java}\"",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc