New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-native-navigators

Package Overview
Dependencies
Maintainers
5
Versions
179
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-navigators - npm Package Compare versions

Comparing version 0.3.0-31 to 0.3.0-32

8

lib/SplitRouter.js

@@ -11,4 +11,6 @@ import { StackRouter, NavigationActions } from 'react-navigation';

// 如果在 SplitRouter 中对 primary route 的子路由做 NAVIGATE 导航会导致右侧路由退出,交互不符合预期
if ((newState === null || newState === void 0 ? void 0 : newState.index) === 0 && state.index > 0) {
return Object.assign(Object.assign({}, newState), { index: state.index, routes: [...newState.routes, ...state.routes.slice(1)] });
if (newState && newState.index > -1 && newState.index < state.index) {
const newRoutes = state.routes.slice();
newRoutes.splice(newState.index, 1, newState.routes[newState.index]);
return Object.assign(Object.assign({}, newState), { index: state.index, routes: newRoutes });
}

@@ -23,3 +25,3 @@ else {

// 如果 SplitRouter 中对 primary route 的子路由做 BACK 导航会导致右侧路由退出,交互不符合预期
if ((newState === null || newState === void 0 ? void 0 : newState.index) === 0 && newState.routes.length > 1) {
if (newState && newState.index < newState.routes.length - 1) {
return Object.assign(Object.assign({}, newState), { index: newState.routes.length - 1 });

@@ -26,0 +28,0 @@ }

{
"version": "0.3.0-31",
"version": "0.3.0-32",
"name": "react-native-navigators",

@@ -4,0 +4,0 @@ "repository": {

@@ -33,7 +33,10 @@ import {

// 如果在 SplitRouter 中对 primary route 的子路由做 NAVIGATE 导航会导致右侧路由退出,交互不符合预期
if (newState?.index === 0 && state.index > 0) {
if (newState && newState.index > -1 && newState.index < state.index) {
const newRoutes = state.routes.slice();
newRoutes.splice(newState.index, 1, newState.routes[newState.index]);
return {
...newState,
index: state.index,
routes: [...newState.routes, ...state.routes.slice(1)]
routes: newRoutes
};

@@ -51,3 +54,3 @@ } else {

// 如果 SplitRouter 中对 primary route 的子路由做 BACK 导航会导致右侧路由退出,交互不符合预期
if (newState?.index === 0 && newState.routes.length > 1) {
if (newState && newState.index < newState.routes.length - 1) {
return {

@@ -54,0 +57,0 @@ ...newState,

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

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