react-native-navigators
Advanced tools
Comparing version 0.3.0-38 to 0.3.0-39
@@ -1,2 +0,2 @@ | ||
import React, { useState, createContext, useMemo, useCallback } from 'react'; | ||
import React, { useState, createContext, useMemo, useCallback, useEffect } from 'react'; | ||
export const NativeSplitNavigatorOptionsContext = createContext({ options: {}, setOptions: () => { } }); | ||
@@ -12,6 +12,31 @@ export default function NativeSplitNavigatorOptionsWrapper(props) { | ||
const [isSplitFullScreen, setIsSplitFullScreen] = useState(() => options === null || options === void 0 ? void 0 : options.isSplitFullScreen); | ||
useEffect(() => { | ||
if ((options === null || options === void 0 ? void 0 : options.isSplitFullScreen) !== isSplitFullScreen) { | ||
setIsSplitFullScreen(options === null || options === void 0 ? void 0 : options.isSplitFullScreen); | ||
} | ||
}, [options === null || options === void 0 ? void 0 : options.isSplitFullScreen]); | ||
const [splitRules, setSplitRules] = useState(() => options === null || options === void 0 ? void 0 : options.splitRules); | ||
useEffect(() => { | ||
if ((options === null || options === void 0 ? void 0 : options.splitRules) !== splitRules) { | ||
setSplitRules(options === null || options === void 0 ? void 0 : options.splitRules); | ||
} | ||
}, [options === null || options === void 0 ? void 0 : options.splitRules]); | ||
const [splitPlaceholder, setSplitPlaceholder] = useState(() => options === null || options === void 0 ? void 0 : options.splitPlaceholder); | ||
useEffect(() => { | ||
if ((options === null || options === void 0 ? void 0 : options.splitPlaceholder) !== splitPlaceholder) { | ||
setSplitPlaceholder(options === null || options === void 0 ? void 0 : options.splitPlaceholder); | ||
} | ||
}, [options === null || options === void 0 ? void 0 : options.splitPlaceholder]); | ||
const [splitPrimaryRouteNames, setSplitPrimaryRouteNames] = useState(() => options === null || options === void 0 ? void 0 : options.splitPrimaryRouteNames); | ||
useEffect(() => { | ||
if ((options === null || options === void 0 ? void 0 : options.splitPrimaryRouteNames) !== splitPrimaryRouteNames) { | ||
setSplitPrimaryRouteNames(options === null || options === void 0 ? void 0 : options.splitPrimaryRouteNames); | ||
} | ||
}, [options === null || options === void 0 ? void 0 : options.splitPrimaryRouteNames]); | ||
const [splitLineColor, setSplitLineColor] = useState(() => options === null || options === void 0 ? void 0 : options.splitLineColor); | ||
useEffect(() => { | ||
if ((options === null || options === void 0 ? void 0 : options.splitLineColor) !== splitLineColor) { | ||
setSplitLineColor(options === null || options === void 0 ? void 0 : options.splitLineColor); | ||
} | ||
}, [options === null || options === void 0 ? void 0 : options.splitLineColor]); | ||
const setOptions = useCallback((options) => { | ||
@@ -18,0 +43,0 @@ if (options.hasOwnProperty('isSplitFullScreen')) { |
{ | ||
"version": "0.3.0-38", | ||
"version": "0.3.0-39", | ||
"name": "react-native-navigators", | ||
@@ -4,0 +4,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
398788
4079