mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-01-13 09:30:30 +08:00
Compare commits
6 Commits
@react-nav
...
@react-nav
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9810a06061 | ||
|
|
655a220137 | ||
|
|
e61f5941d7 | ||
|
|
8b78d617c0 | ||
|
|
1fd5a868a3 | ||
|
|
1153d5575b |
@@ -3,6 +3,18 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
# [5.0.0-alpha.10](https://github.com/react-navigation/navigation-ex/compare/@react-navigation/bottom-tabs@5.0.0-alpha.9...@react-navigation/bottom-tabs@5.0.0-alpha.10) (2019-09-27)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* export BottomTabBar props type ([#109](https://github.com/react-navigation/navigation-ex/issues/109)) ([1fd5a86](https://github.com/react-navigation/navigation-ex/commit/1fd5a86))
|
||||
* export some more type aliases ([8b78d61](https://github.com/react-navigation/navigation-ex/commit/8b78d61))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [5.0.0-alpha.9](https://github.com/react-navigation/navigation-ex/compare/@react-navigation/bottom-tabs@5.0.0-alpha.8...@react-navigation/bottom-tabs@5.0.0-alpha.9) (2019-09-17)
|
||||
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
"android",
|
||||
"tab"
|
||||
],
|
||||
"version": "5.0.0-alpha.9",
|
||||
"version": "5.0.0-alpha.10",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -33,7 +33,7 @@
|
||||
"clean": "del lib"
|
||||
},
|
||||
"dependencies": {
|
||||
"@react-navigation/routers": "^5.0.0-alpha.7",
|
||||
"@react-navigation/routers": "^5.0.0-alpha.8",
|
||||
"react-native-safe-area-view": "^0.14.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -13,4 +13,9 @@ export { default as BottomTabBar } from './views/BottomTabBar';
|
||||
/**
|
||||
* Types
|
||||
*/
|
||||
export { BottomTabNavigationOptions, BottomTabNavigationProp } from './types';
|
||||
export {
|
||||
BottomTabNavigationOptions,
|
||||
BottomTabNavigationProp,
|
||||
BottomTabBarProps,
|
||||
BottomTabBarOptions,
|
||||
} from './types';
|
||||
|
||||
@@ -232,5 +232,7 @@ export type BottomTabBarProps = BottomTabBarOptions & {
|
||||
tintColor: string;
|
||||
horizontal: boolean;
|
||||
}) => React.ReactNode;
|
||||
activeTintColor: string;
|
||||
inactiveTintColor: string;
|
||||
safeAreaInset?: React.ComponentProps<typeof SafeAreaView>['forceInset'];
|
||||
};
|
||||
|
||||
@@ -23,8 +23,6 @@ type State = {
|
||||
};
|
||||
|
||||
type Props = BottomTabBarProps & {
|
||||
activeTintColor: string;
|
||||
inactiveTintColor: string;
|
||||
safeAreaInset: React.ComponentProps<typeof SafeAreaView>['forceInset'];
|
||||
};
|
||||
|
||||
|
||||
@@ -3,6 +3,14 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
# [5.0.0-alpha.4](https://github.com/react-navigation/navigation-ex/compare/@react-navigation/compat@5.0.0-alpha.3...@react-navigation/compat@5.0.0-alpha.4) (2019-09-27)
|
||||
|
||||
**Note:** Version bump only for package @react-navigation/compat
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [5.0.0-alpha.3](https://github.com/react-navigation/navigation-ex/compare/@react-navigation/compat@5.0.0-alpha.2...@react-navigation/compat@5.0.0-alpha.3) (2019-09-23)
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@react-navigation/compat",
|
||||
"description": "Compatibility layer to write navigator definitions in static configuration format",
|
||||
"version": "5.0.0-alpha.3",
|
||||
"version": "5.0.0-alpha.4",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -24,7 +24,7 @@
|
||||
"clean": "del lib"
|
||||
},
|
||||
"dependencies": {
|
||||
"@react-navigation/routers": "^5.0.0-alpha.7"
|
||||
"@react-navigation/routers": "^5.0.0-alpha.8"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/react": "^16.8.19",
|
||||
|
||||
@@ -3,6 +3,22 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
# [5.0.0-alpha.11](https://github.com/react-navigation/navigation-ex/compare/@react-navigation/core@5.0.0-alpha.10...@react-navigation/core@5.0.0-alpha.11) (2019-09-27)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* fire blur event when a route is removed with a delay ([1153d55](https://github.com/react-navigation/navigation-ex/commit/1153d55)), closes [#110](https://github.com/react-navigation/navigation-ex/issues/110)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add a method to reset root navigator state ([e61f594](https://github.com/react-navigation/navigation-ex/commit/e61f594))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [5.0.0-alpha.10](https://github.com/react-navigation/navigation-ex/compare/@react-navigation/core@5.0.0-alpha.9...@react-navigation/core@5.0.0-alpha.10) (2019-09-17)
|
||||
|
||||
**Note:** Version bump only for package @react-navigation/core
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"react-native",
|
||||
"react-navigation"
|
||||
],
|
||||
"version": "5.0.0-alpha.10",
|
||||
"version": "5.0.0-alpha.11",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
||||
@@ -2,6 +2,7 @@ import * as React from 'react';
|
||||
import * as CommonActions from './CommonActions';
|
||||
import EnsureSingleNavigator from './EnsureSingleNavigator';
|
||||
import NavigationBuilderContext from './NavigationBuilderContext';
|
||||
import ResetRootContext from './ResetRootContext';
|
||||
import useFocusedListeners from './useFocusedListeners';
|
||||
import useDevTools from './useDevTools';
|
||||
|
||||
@@ -86,6 +87,23 @@ const Container = React.forwardRef(function NavigationContainer(
|
||||
getPartialState(initialState)
|
||||
);
|
||||
|
||||
const navigationStateRef = React.useRef<State>();
|
||||
const transactionStateRef = React.useRef<State | null>(null);
|
||||
const isTransactionActiveRef = React.useRef<boolean>(false);
|
||||
const isFirstMountRef = React.useRef<boolean>(true);
|
||||
const skipTrackingRef = React.useRef<boolean>(false);
|
||||
|
||||
const reset = React.useCallback((state: NavigationState) => {
|
||||
skipTrackingRef.current = true;
|
||||
setNavigationState(state);
|
||||
}, []);
|
||||
|
||||
const { trackState, trackAction } = useDevTools({
|
||||
name: '@react-navigation',
|
||||
reset,
|
||||
state,
|
||||
});
|
||||
|
||||
const { listeners, addListener: addFocusedListener } = useFocusedListeners();
|
||||
|
||||
const dispatch = (
|
||||
@@ -106,6 +124,14 @@ const Container = React.forwardRef(function NavigationContainer(
|
||||
}
|
||||
};
|
||||
|
||||
const resetRoot = React.useCallback(
|
||||
(state: PartialState<NavigationState> | NavigationState) => {
|
||||
trackAction('@@RESET_ROOT');
|
||||
setNavigationState(state);
|
||||
},
|
||||
[trackAction]
|
||||
);
|
||||
|
||||
React.useImperativeHandle(ref, () => ({
|
||||
...(Object.keys(CommonActions) as Array<keyof typeof CommonActions>).reduce<
|
||||
any
|
||||
@@ -120,31 +146,11 @@ const Container = React.forwardRef(function NavigationContainer(
|
||||
);
|
||||
return acc;
|
||||
}, {}),
|
||||
resetRoot: (state: PartialState<NavigationState> | NavigationState) => {
|
||||
trackAction('@@RESET_ROOT');
|
||||
setNavigationState(state);
|
||||
},
|
||||
resetRoot,
|
||||
dispatch,
|
||||
canGoBack,
|
||||
}));
|
||||
|
||||
const navigationStateRef = React.useRef<State>();
|
||||
const transactionStateRef = React.useRef<State | null>(null);
|
||||
const isTransactionActiveRef = React.useRef<boolean>(false);
|
||||
const isFirstMountRef = React.useRef<boolean>(true);
|
||||
const skipTrackingRef = React.useRef<boolean>(false);
|
||||
|
||||
const reset = React.useCallback((state: NavigationState) => {
|
||||
skipTrackingRef.current = true;
|
||||
setNavigationState(state);
|
||||
}, []);
|
||||
|
||||
const { trackState, trackAction } = useDevTools({
|
||||
name: '@react-navigation',
|
||||
reset,
|
||||
state,
|
||||
});
|
||||
|
||||
const builderContext = React.useMemo(
|
||||
() => ({
|
||||
addFocusedListener,
|
||||
@@ -220,7 +226,9 @@ const Container = React.forwardRef(function NavigationContainer(
|
||||
return (
|
||||
<NavigationBuilderContext.Provider value={builderContext}>
|
||||
<NavigationStateContext.Provider value={context}>
|
||||
<EnsureSingleNavigator>{children}</EnsureSingleNavigator>
|
||||
<ResetRootContext.Provider value={resetRoot}>
|
||||
<EnsureSingleNavigator>{children}</EnsureSingleNavigator>
|
||||
</ResetRootContext.Provider>
|
||||
</NavigationStateContext.Provider>
|
||||
</NavigationBuilderContext.Provider>
|
||||
);
|
||||
|
||||
15
packages/core/src/ResetRootContext.tsx
Normal file
15
packages/core/src/ResetRootContext.tsx
Normal file
@@ -0,0 +1,15 @@
|
||||
import * as React from 'react';
|
||||
import { NavigationState, PartialState } from './types';
|
||||
|
||||
/**
|
||||
* Context which holds the method to reset root navigator state.
|
||||
*/
|
||||
const ResetRootContext = React.createContext<
|
||||
(state: PartialState<NavigationState> | NavigationState) => void
|
||||
>(() => {
|
||||
throw new Error(
|
||||
"We couldn't find a way to reset root state. Have you wrapped your app with 'NavigationContainer'?"
|
||||
);
|
||||
});
|
||||
|
||||
export default ResetRootContext;
|
||||
@@ -4,6 +4,7 @@ import useNavigationBuilder from '../useNavigationBuilder';
|
||||
import NavigationContainer from '../NavigationContainer';
|
||||
import Screen from '../Screen';
|
||||
import MockRouter from './__fixtures__/MockRouter';
|
||||
import { Router, NavigationState } from '../types';
|
||||
|
||||
it('fires focus and blur events in root navigator', () => {
|
||||
const TestNavigator = React.forwardRef((props: any, ref: any): any => {
|
||||
@@ -200,6 +201,131 @@ it('fires focus and blur events in nested navigator', () => {
|
||||
expect(thirdFocusCallback).toBeCalledTimes(1);
|
||||
});
|
||||
|
||||
it('fires blur event when a route is removed with a delay', async () => {
|
||||
const TestRouter = (options: any): Router<NavigationState, any> => {
|
||||
const router = MockRouter(options);
|
||||
|
||||
return {
|
||||
...router,
|
||||
|
||||
getInitialState({ routeNames, routeParamList }) {
|
||||
const initialRouteName =
|
||||
options.initialRouteName !== undefined
|
||||
? options.initialRouteName
|
||||
: routeNames[0];
|
||||
|
||||
return {
|
||||
stale: false,
|
||||
key: 'stack',
|
||||
index: 0,
|
||||
routeNames,
|
||||
routes: [
|
||||
{
|
||||
key: initialRouteName,
|
||||
name: initialRouteName,
|
||||
params: routeParamList[initialRouteName],
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
|
||||
getStateForAction(state, action) {
|
||||
switch (action.type) {
|
||||
case 'PUSH':
|
||||
return {
|
||||
...state,
|
||||
index: state.index + 1,
|
||||
routes: [...state.routes, action.payload],
|
||||
};
|
||||
case 'POP': {
|
||||
const routes = state.routes.slice(0, -1);
|
||||
|
||||
return {
|
||||
...state,
|
||||
index: routes.length - 1,
|
||||
routes,
|
||||
};
|
||||
}
|
||||
default:
|
||||
return router.getStateForAction(state, action);
|
||||
}
|
||||
},
|
||||
|
||||
actionCreators: {
|
||||
push(payload) {
|
||||
return { type: 'PUSH', payload };
|
||||
},
|
||||
|
||||
pop() {
|
||||
return { type: 'POP' };
|
||||
},
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
const TestNavigator = React.forwardRef((props: any, ref: any): any => {
|
||||
const { state, navigation, descriptors } = useNavigationBuilder(
|
||||
TestRouter,
|
||||
props
|
||||
);
|
||||
|
||||
React.useImperativeHandle(ref, () => navigation, [navigation]);
|
||||
|
||||
const [previous, dispatch] = React.useReducer(
|
||||
(state, action) => {
|
||||
return { ...state, ...action };
|
||||
},
|
||||
{ routes: state.routes, descriptors }
|
||||
);
|
||||
|
||||
React.useEffect(() => {
|
||||
dispatch({ routes: state.routes, descriptors });
|
||||
}, [descriptors, state.routes]);
|
||||
|
||||
return previous.routes.map((route: any) =>
|
||||
previous.descriptors[route.key].render()
|
||||
);
|
||||
});
|
||||
|
||||
const blurCallback = jest.fn();
|
||||
|
||||
const First = () => null;
|
||||
|
||||
const Second = ({ navigation }: any) => {
|
||||
React.useEffect(() => navigation.addListener('blur', blurCallback), [
|
||||
navigation,
|
||||
]);
|
||||
|
||||
return null;
|
||||
};
|
||||
|
||||
const navigation = React.createRef<any>();
|
||||
|
||||
const element = (
|
||||
<NavigationContainer>
|
||||
<TestNavigator ref={navigation}>
|
||||
<Screen name="first" component={First} />
|
||||
<Screen name="second" component={Second} />
|
||||
</TestNavigator>
|
||||
</NavigationContainer>
|
||||
);
|
||||
|
||||
render(element);
|
||||
|
||||
act(() =>
|
||||
navigation.current.push({
|
||||
name: 'second',
|
||||
key: 'second',
|
||||
})
|
||||
);
|
||||
|
||||
expect(blurCallback).toBeCalledTimes(0);
|
||||
|
||||
act(() => navigation.current.pop());
|
||||
|
||||
expect(blurCallback).toBeCalledTimes(1);
|
||||
});
|
||||
|
||||
it('fires custom events', () => {
|
||||
const eventName = 'someSuperCoolEvent';
|
||||
|
||||
|
||||
@@ -316,6 +316,13 @@ type NavigationHelpersCommon<
|
||||
*/
|
||||
reset(state: PartialState<State> | State): void;
|
||||
|
||||
/**
|
||||
* Reset the navigation state of the root navigator to the provided state.
|
||||
*
|
||||
* @param state Navigation state object.
|
||||
*/
|
||||
resetRoot(state: PartialState<NavigationState> | NavigationState): void;
|
||||
|
||||
/**
|
||||
* Go back to the previous route in history.
|
||||
*/
|
||||
|
||||
@@ -57,19 +57,19 @@ export default function useFocusEvents({ state, emitter }: Options) {
|
||||
return;
|
||||
}
|
||||
|
||||
state.routes.forEach((route, i) => {
|
||||
if (
|
||||
lastFocusedKey === undefined ||
|
||||
(route.key !== lastFocusedKey && route.key !== currentFocusedKey)
|
||||
) {
|
||||
// Only fire events after mount, or if focus state of this route changed
|
||||
return;
|
||||
}
|
||||
if (lastFocusedKey === undefined) {
|
||||
// Only fire events after initial mount
|
||||
return;
|
||||
}
|
||||
|
||||
emitter.emit({
|
||||
type: i === state.index ? 'focus' : 'blur',
|
||||
target: route.key,
|
||||
});
|
||||
emitter.emit({
|
||||
type: 'focus',
|
||||
target: currentFocusedKey,
|
||||
});
|
||||
}, [currentFocusedKey, emitter, navigation, state.index, state.routes]);
|
||||
|
||||
emitter.emit({
|
||||
type: 'blur',
|
||||
target: lastFocusedKey,
|
||||
});
|
||||
}, [currentFocusedKey, emitter, navigation]);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import * as React from 'react';
|
||||
import * as CommonActions from './CommonActions';
|
||||
import NavigationContext from './NavigationContext';
|
||||
import ResetRootContext from './ResetRootContext';
|
||||
import { NavigationStateContext } from './NavigationContainer';
|
||||
import { NavigationEventEmitter } from './useEventEmitter';
|
||||
import {
|
||||
@@ -36,6 +37,7 @@ export default function useNavigationHelpers<
|
||||
Action extends NavigationAction,
|
||||
EventMap extends { [key: string]: any }
|
||||
>({ onAction, getState, emitter, router }: Options<State, Action>) {
|
||||
const resetRoot = React.useContext(ResetRootContext);
|
||||
const parentNavigationHelpers = React.useContext(NavigationContext);
|
||||
const { performTransaction } = React.useContext(NavigationStateContext);
|
||||
|
||||
@@ -65,6 +67,7 @@ export default function useNavigationHelpers<
|
||||
return {
|
||||
...parentNavigationHelpers,
|
||||
...helpers,
|
||||
resetRoot,
|
||||
dispatch,
|
||||
emit: emitter.emit,
|
||||
isFocused: parentNavigationHelpers
|
||||
@@ -83,6 +86,7 @@ export default function useNavigationHelpers<
|
||||
router,
|
||||
getState,
|
||||
parentNavigationHelpers,
|
||||
resetRoot,
|
||||
emitter.emit,
|
||||
performTransaction,
|
||||
onAction,
|
||||
|
||||
@@ -3,6 +3,17 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
# [5.0.0-alpha.10](https://github.com/react-navigation/navigation-ex/compare/@react-navigation/drawer@5.0.0-alpha.9...@react-navigation/drawer@5.0.0-alpha.10) (2019-09-27)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* export some more type aliases ([8b78d61](https://github.com/react-navigation/navigation-ex/commit/8b78d61))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [5.0.0-alpha.9](https://github.com/react-navigation/navigation-ex/compare/@react-navigation/drawer@5.0.0-alpha.8...@react-navigation/drawer@5.0.0-alpha.9) (2019-09-16)
|
||||
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
"material",
|
||||
"drawer"
|
||||
],
|
||||
"version": "5.0.0-alpha.9",
|
||||
"version": "5.0.0-alpha.10",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -34,7 +34,7 @@
|
||||
"clean": "del lib"
|
||||
},
|
||||
"dependencies": {
|
||||
"@react-navigation/routers": "^5.0.0-alpha.7",
|
||||
"@react-navigation/routers": "^5.0.0-alpha.8",
|
||||
"react-native-safe-area-view": "^0.14.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -20,4 +20,8 @@ export { default as DrawerGestureContext } from './utils/DrawerGestureContext';
|
||||
/**
|
||||
* Types
|
||||
*/
|
||||
export { DrawerNavigationOptions, DrawerNavigationProp } from './types';
|
||||
export {
|
||||
DrawerNavigationOptions,
|
||||
DrawerNavigationProp,
|
||||
DrawerNavigationItemsProps,
|
||||
} from './types';
|
||||
|
||||
@@ -3,6 +3,17 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
# [5.0.0-alpha.8](https://github.com/react-navigation/navigation-ex/compare/@react-navigation/example@5.0.0-alpha.7...@react-navigation/example@5.0.0-alpha.8) (2019-09-27)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* close drawer on navigate ([655a220](https://github.com/react-navigation/navigation-ex/commit/655a220))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [5.0.0-alpha.7](https://github.com/satya164/navigation-ex/compare/@react-navigation/example@5.0.0-alpha.6...@react-navigation/example@5.0.0-alpha.7) (2019-09-16)
|
||||
|
||||
|
||||
|
||||
19
packages/example/android/ReactNavigationExample.iml
Normal file
19
packages/example/android/ReactNavigationExample.iml
Normal file
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module external.linked.project.id="ReactNavigationExample" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" type="JAVA_MODULE" version="4">
|
||||
<component name="FacetManager">
|
||||
<facet type="java-gradle" name="Java-Gradle">
|
||||
<configuration>
|
||||
<option name="BUILD_FOLDER_PATH" value="$MODULE_DIR$/build" />
|
||||
<option name="BUILDABLE" value="false" />
|
||||
</configuration>
|
||||
</facet>
|
||||
</component>
|
||||
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<excludeFolder url="file://$MODULE_DIR$/.gradle" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
179
packages/example/android/app/app.iml
Normal file
179
packages/example/android/app/app.iml
Normal file
@@ -0,0 +1,179 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module external.linked.project.id=":app" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" type="JAVA_MODULE" version="4">
|
||||
<component name="FacetManager">
|
||||
<facet type="android-gradle" name="Android-Gradle">
|
||||
<configuration>
|
||||
<option name="GRADLE_PROJECT_PATH" value=":app" />
|
||||
<option name="LAST_SUCCESSFUL_SYNC_AGP_VERSION" value="3.3.0" />
|
||||
<option name="LAST_KNOWN_AGP_VERSION" value="3.3.0" />
|
||||
</configuration>
|
||||
</facet>
|
||||
<facet type="android" name="Android">
|
||||
<configuration>
|
||||
<option name="SELECTED_BUILD_VARIANT" value="debug" />
|
||||
<option name="ASSEMBLE_TASK_NAME" value="assembleDebug" />
|
||||
<option name="COMPILE_JAVA_TASK_NAME" value="compileDebugSources" />
|
||||
<afterSyncTasks>
|
||||
<task>generateDebugSources</task>
|
||||
</afterSyncTasks>
|
||||
<option name="ALLOW_USER_CONFIGURATION" value="false" />
|
||||
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" />
|
||||
<option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" />
|
||||
<option name="RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/src/main/res;file://$MODULE_DIR$/build/generated/res/rs/debug;file://$MODULE_DIR$/build/generated/res/resValues/debug" />
|
||||
<option name="TEST_RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/build/generated/res/rs/androidTest/debug" />
|
||||
<option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets" />
|
||||
</configuration>
|
||||
</facet>
|
||||
</component>
|
||||
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
|
||||
<output url="file://$MODULE_DIR$/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes" />
|
||||
<output-test url="file://$MODULE_DIR$/build/intermediates/javac/debugUnitTest/compileDebugUnitTestJavaWithJavac/classes" />
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/debug" isTestSource="false" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/aidl_source_output_dir/debug/compileDebugAidl/out" isTestSource="false" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/debug" isTestSource="false" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/renderscript_source_output_dir/debug/compileDebugRenderscript/out" isTestSource="false" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/react/debug" type="java-resource" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/debug" type="java-resource" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/debug" type="java-resource" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/androidTest/debug" isTestSource="true" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/aidl_source_output_dir/debugAndroidTest/compileDebugAndroidTestAidl/out" isTestSource="true" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/debug" isTestSource="true" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/renderscript_source_output_dir/debugAndroidTest/compileDebugAndroidTestRenderscript/out" isTestSource="true" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/debug" type="java-test-resource" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/androidTest/debug" type="java-test-resource" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/test/debug" isTestSource="true" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/debug/resources" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/debug/aidl" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/debug/java" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/debug/rs" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/debug/shaders" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/res" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/resources" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/assets" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/aidl" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/java" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/rs" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/shaders" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/res" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/resources" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/assets" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/aidl" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/java" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/rs" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/shaders" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/res" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/assets" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/aidl" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/shaders" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/aidl" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build" />
|
||||
</content>
|
||||
<orderEntry type="jdk" jdkName="Android API 28 Platform" jdkType="Android SDK" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" name="Gradle: com.android.support:collections:28.0.0@jar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: android.arch.lifecycle:common:1.1.1@jar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: android.arch.core:common:1.1.1@jar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.android.support:support-annotations:28.0.0@jar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.facebook.infer.annotation:infer-annotation:0.11.2@jar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: javax.inject:javax.inject:1@jar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.google.code.findbugs:jsr305:3.0.2@jar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.squareup.okhttp3:okhttp-urlconnection:3.12.1@jar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.squareup.okhttp3:okhttp:3.12.1@jar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.squareup.okio:okio:1.15.0@jar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.facebook.device.yearclass:yearclass:2.1.0@jar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: commons-codec:commons-codec:1.10@jar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: commons-io:commons-io:1.4@jar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.github.bumptech.glide:disklrucache:4.9.0@jar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.github.bumptech.glide:annotations:4.9.0@jar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.parse.bolts:bolts-tasks:1.4.0@jar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.facebook.react:react-native:0.59.10@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.android.support:appcompat-v7:28.0.0@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.github.bumptech.glide:glide:4.9.0@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.google.android.gms:play-services-location:16.0.0@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.google.android.gms:play-services-base:16.0.1@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.google.android.gms:play-services-places-placereport:16.0.0@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.google.android.gms:play-services-tasks:16.0.1@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.google.android.gms:play-services-basement:16.0.1@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.android.support:support-v4:28.0.0@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.android.support:support-fragment:28.0.0@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.android.support:animated-vector-drawable:28.0.0@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.android.support:customtabs:28.0.0@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.android.support:support-core-ui:28.0.0@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.android.support:support-core-utils:28.0.0@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.android.support:support-vector-drawable:28.0.0@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.android.support:loader:28.0.0@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.android.support:support-media-compat:28.0.0@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.android.support:viewpager:28.0.0@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.android.support:coordinatorlayout:28.0.0@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.android.support:drawerlayout:28.0.0@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.android.support:slidingpanelayout:28.0.0@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.android.support:customview:28.0.0@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.android.support:swiperefreshlayout:28.0.0@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.android.support:asynclayoutinflater:28.0.0@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.android.support:support-compat:28.0.0@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.android.support:versionedparcelable:28.0.0@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.android.support:cursoradapter:28.0.0@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: android.arch.lifecycle:runtime:1.1.1@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.android.support:documentfile:28.0.0@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.android.support:localbroadcastmanager:28.0.0@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.android.support:print:28.0.0@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: android.arch.lifecycle:viewmodel:1.1.1@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.github.bumptech.glide:gifdecoder:4.9.0@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.android.support:interpolator:28.0.0@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: android.arch.lifecycle:livedata:1.1.1@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: android.arch.lifecycle:livedata-core:1.1.1@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: android.arch.core:runtime:1.1.1@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.facebook.fresco:fresco:1.10.0@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.facebook.fresco:imagepipeline-okhttp3:1.10.0@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.facebook.fresco:drawee:1.10.0@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.facebook.fresco:imagepipeline:1.10.0@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.facebook.fresco:imagepipeline-base:1.10.0@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.facebook.soloader:soloader:0.6.0@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: io.nlopez.smartlocation:library:3.2.11@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.facebook.fresco:fbcore:1.10.0@aar" level="project" />
|
||||
<orderEntry type="module" module-name="react-native-reanimated" />
|
||||
<orderEntry type="module" module-name="react-native-gesture-handler" />
|
||||
<orderEntry type="module" module-name="expo-permissions" />
|
||||
<orderEntry type="module" module-name="unimodules-core" />
|
||||
<orderEntry type="module" module-name="unimodules-react-native-adapter" />
|
||||
<orderEntry type="module" module-name="expo-app-loader-provider" />
|
||||
<orderEntry type="module" module-name="expo-constants" />
|
||||
<orderEntry type="module" module-name="expo-file-system" />
|
||||
<orderEntry type="module" module-name="expo-font" />
|
||||
<orderEntry type="module" module-name="expo-keep-awake" />
|
||||
<orderEntry type="module" module-name="expo-linear-gradient" />
|
||||
<orderEntry type="module" module-name="expo-location" />
|
||||
<orderEntry type="module" module-name="expo-sqlite" />
|
||||
<orderEntry type="module" module-name="expo-web-browser" />
|
||||
<orderEntry type="module" module-name="unimodules-barcode-scanner-interface" />
|
||||
<orderEntry type="module" module-name="unimodules-camera-interface" />
|
||||
<orderEntry type="module" module-name="unimodules-constants-interface" />
|
||||
<orderEntry type="module" module-name="unimodules-face-detector-interface" />
|
||||
<orderEntry type="module" module-name="unimodules-file-system-interface" />
|
||||
<orderEntry type="module" module-name="unimodules-font-interface" />
|
||||
<orderEntry type="module" module-name="unimodules-image-loader-interface" />
|
||||
<orderEntry type="module" module-name="unimodules-permissions-interface" />
|
||||
<orderEntry type="module" module-name="unimodules-sensors-interface" />
|
||||
<orderEntry type="module" module-name="unimodules-task-manager-interface" />
|
||||
</component>
|
||||
</module>
|
||||
8
packages/example/android/local.properties
Normal file
8
packages/example/android/local.properties
Normal file
@@ -0,0 +1,8 @@
|
||||
## This file must *NOT* be checked into Version Control Systems,
|
||||
# as it contains information specific to your local configuration.
|
||||
#
|
||||
# Location of the SDK. This is only used by Gradle.
|
||||
# For customization when using a Version Control System, please read the
|
||||
# header note.
|
||||
#Wed Sep 18 15:42:44 CEST 2019
|
||||
sdk.dir=/Users/osdnk/Library/Android/sdk
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@react-navigation/example",
|
||||
"description": "Demo app to showcase various functionality of React Navigation",
|
||||
"version": "5.0.0-alpha.7",
|
||||
"version": "5.0.0-alpha.8",
|
||||
"private": true,
|
||||
"workspaces": {
|
||||
"nohoist": [
|
||||
|
||||
@@ -3,6 +3,14 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
# [5.0.0-alpha.9](https://github.com/react-navigation/navigation-ex/compare/@react-navigation/material-bottom-tabs@5.0.0-alpha.8...@react-navigation/material-bottom-tabs@5.0.0-alpha.9) (2019-09-27)
|
||||
|
||||
**Note:** Version bump only for package @react-navigation/material-bottom-tabs
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [5.0.0-alpha.8](https://github.com/react-navigation/navigation-ex/compare/@react-navigation/material-bottom-tabs@5.0.0-alpha.7...@react-navigation/material-bottom-tabs@5.0.0-alpha.8) (2019-09-16)
|
||||
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
"material",
|
||||
"tab"
|
||||
],
|
||||
"version": "5.0.0-alpha.8",
|
||||
"version": "5.0.0-alpha.9",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -34,7 +34,7 @@
|
||||
"clean": "del lib"
|
||||
},
|
||||
"dependencies": {
|
||||
"@react-navigation/routers": "^5.0.0-alpha.7"
|
||||
"@react-navigation/routers": "^5.0.0-alpha.8"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@react-native-community/bob": "^0.7.0",
|
||||
|
||||
@@ -3,6 +3,17 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
# [5.0.0-alpha.8](https://github.com/react-navigation/navigation-ex/compare/@react-navigation/material-top-tabs@5.0.0-alpha.7...@react-navigation/material-top-tabs@5.0.0-alpha.8) (2019-09-27)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* export some more type aliases ([8b78d61](https://github.com/react-navigation/navigation-ex/commit/8b78d61))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [5.0.0-alpha.7](https://github.com/react-navigation/navigation-ex/compare/@react-navigation/material-top-tabs@5.0.0-alpha.6...@react-navigation/material-top-tabs@5.0.0-alpha.7) (2019-08-31)
|
||||
|
||||
**Note:** Version bump only for package @react-navigation/material-top-tabs
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
"material",
|
||||
"tab"
|
||||
],
|
||||
"version": "5.0.0-alpha.7",
|
||||
"version": "5.0.0-alpha.8",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -34,7 +34,7 @@
|
||||
"clean": "del lib"
|
||||
},
|
||||
"dependencies": {
|
||||
"@react-navigation/routers": "^5.0.0-alpha.7"
|
||||
"@react-navigation/routers": "^5.0.0-alpha.8"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@react-native-community/bob": "^0.7.0",
|
||||
|
||||
@@ -16,4 +16,6 @@ export { default as MaterialTopTabBar } from './views/MaterialTopTabBar';
|
||||
export {
|
||||
MaterialTopTabNavigationOptions,
|
||||
MaterialTopTabNavigationProp,
|
||||
MaterialTopTabBarProps,
|
||||
MaterialTopTabBarOptions,
|
||||
} from './types';
|
||||
|
||||
@@ -3,6 +3,17 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
# [5.0.0-alpha.8](https://github.com/react-navigation/navigation-ex/compare/@react-navigation/routers@5.0.0-alpha.7...@react-navigation/routers@5.0.0-alpha.8) (2019-09-27)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* close drawer on navigate ([655a220](https://github.com/react-navigation/navigation-ex/commit/655a220))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [5.0.0-alpha.7](https://github.com/react-navigation/navigation-ex/compare/@react-navigation/routers@5.0.0-alpha.6...@react-navigation/routers@5.0.0-alpha.7) (2019-08-31)
|
||||
|
||||
|
||||
|
||||
@@ -215,6 +215,36 @@ it('handles navigate action', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('handles navigate action with open drawer', () => {
|
||||
const router = DrawerRouter({});
|
||||
|
||||
expect(
|
||||
router.getStateForAction(
|
||||
{
|
||||
stale: false,
|
||||
key: 'root',
|
||||
index: 1,
|
||||
routeNames: ['baz', 'bar'],
|
||||
routeKeyHistory: [],
|
||||
isDrawerOpen: true,
|
||||
routes: [{ key: 'baz', name: 'baz' }, { key: 'bar', name: 'bar' }],
|
||||
},
|
||||
CommonActions.navigate('baz', { answer: 42 })
|
||||
)
|
||||
).toEqual({
|
||||
stale: false,
|
||||
key: 'root',
|
||||
index: 0,
|
||||
routeNames: ['baz', 'bar'],
|
||||
isDrawerOpen: false,
|
||||
routeKeyHistory: ['bar'],
|
||||
routes: [
|
||||
{ key: 'baz', name: 'baz', params: { answer: 42 } },
|
||||
{ key: 'bar', name: 'bar' },
|
||||
],
|
||||
});
|
||||
});
|
||||
|
||||
it('handles open drawer action', () => {
|
||||
const router = DrawerRouter({});
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"react-native",
|
||||
"react-navigation"
|
||||
],
|
||||
"version": "5.0.0-alpha.7",
|
||||
"version": "5.0.0-alpha.8",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
||||
@@ -135,6 +135,15 @@ export default function DrawerRouter(
|
||||
isDrawerOpen: !state.isDrawerOpen,
|
||||
};
|
||||
|
||||
case 'NAVIGATE':
|
||||
return router.getStateForAction(
|
||||
{
|
||||
...state,
|
||||
isDrawerOpen: false,
|
||||
},
|
||||
action
|
||||
);
|
||||
|
||||
default:
|
||||
return router.getStateForAction(state, action);
|
||||
}
|
||||
|
||||
@@ -3,6 +3,17 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
# [5.0.0-alpha.20](https://github.com/react-navigation/navigation-ex/compare/@react-navigation/stack@5.0.0-alpha.19...@react-navigation/stack@5.0.0-alpha.20) (2019-09-27)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* export some more type aliases ([8b78d61](https://github.com/react-navigation/navigation-ex/commit/8b78d61))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [5.0.0-alpha.19](https://github.com/react-navigation/navigation-ex/compare/@react-navigation/stack@5.0.0-alpha.18...@react-navigation/stack@5.0.0-alpha.19) (2019-09-23)
|
||||
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
"android",
|
||||
"stack"
|
||||
],
|
||||
"version": "5.0.0-alpha.19",
|
||||
"version": "5.0.0-alpha.20",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -33,7 +33,7 @@
|
||||
"clean": "del lib"
|
||||
},
|
||||
"dependencies": {
|
||||
"@react-navigation/routers": "^5.0.0-alpha.7",
|
||||
"@react-navigation/routers": "^5.0.0-alpha.8",
|
||||
"react-native-safe-area-view": "^0.14.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
import { I18nManager } from 'react-native';
|
||||
import Animated from 'react-native-reanimated';
|
||||
import getStatusBarHeight from '../utils/getStatusBarHeight';
|
||||
import { CardInterpolationProps, CardInterpolatedStyle } from '../types';
|
||||
import {
|
||||
StackCardInterpolationProps,
|
||||
StackCardInterpolatedStyle,
|
||||
} from '../types';
|
||||
|
||||
const { cond, add, multiply, interpolate } = Animated;
|
||||
|
||||
@@ -12,7 +15,7 @@ export function forHorizontalIOS({
|
||||
current,
|
||||
next,
|
||||
layouts: { screen },
|
||||
}: CardInterpolationProps): CardInterpolatedStyle {
|
||||
}: StackCardInterpolationProps): StackCardInterpolatedStyle {
|
||||
const translateFocused = interpolate(current.progress, {
|
||||
inputRange: [0, 1],
|
||||
outputRange: [I18nManager.isRTL ? -screen.width : screen.width, 0],
|
||||
@@ -57,7 +60,7 @@ export function forHorizontalIOS({
|
||||
export function forVerticalIOS({
|
||||
current,
|
||||
layouts: { screen },
|
||||
}: CardInterpolationProps): CardInterpolatedStyle {
|
||||
}: StackCardInterpolationProps): StackCardInterpolatedStyle {
|
||||
const translateY = interpolate(current.progress, {
|
||||
inputRange: [0, 1],
|
||||
outputRange: [screen.height, 0],
|
||||
@@ -81,7 +84,7 @@ export function forModalPresentationIOS({
|
||||
current,
|
||||
next,
|
||||
layouts: { screen },
|
||||
}: CardInterpolationProps): CardInterpolatedStyle {
|
||||
}: StackCardInterpolationProps): StackCardInterpolatedStyle {
|
||||
const topOffset = 10;
|
||||
const statusBarHeight = getStatusBarHeight(screen.width > screen.height);
|
||||
const aspectRatio = screen.height / screen.width;
|
||||
@@ -134,7 +137,7 @@ export function forFadeFromBottomAndroid({
|
||||
current,
|
||||
layouts: { screen },
|
||||
closing,
|
||||
}: CardInterpolationProps): CardInterpolatedStyle {
|
||||
}: StackCardInterpolationProps): StackCardInterpolatedStyle {
|
||||
const translateY = interpolate(current.progress, {
|
||||
inputRange: [0, 1],
|
||||
outputRange: [multiply(screen.height, 0.08), 0],
|
||||
@@ -164,7 +167,7 @@ export function forRevealFromBottomAndroid({
|
||||
current,
|
||||
next,
|
||||
layouts: { screen },
|
||||
}: CardInterpolationProps): CardInterpolatedStyle {
|
||||
}: StackCardInterpolationProps): StackCardInterpolatedStyle {
|
||||
const containerTranslateY = interpolate(current.progress, {
|
||||
inputRange: [0, 1],
|
||||
outputRange: [screen.height, 0],
|
||||
@@ -206,7 +209,7 @@ export function forScaleFromCenterAndroid({
|
||||
current,
|
||||
next,
|
||||
closing,
|
||||
}: CardInterpolationProps): CardInterpolatedStyle {
|
||||
}: StackCardInterpolationProps): StackCardInterpolatedStyle {
|
||||
const progress = add(current.progress, next ? next.progress : 0);
|
||||
|
||||
const opacity = interpolate(progress, {
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
import { I18nManager } from 'react-native';
|
||||
import Animated from 'react-native-reanimated';
|
||||
import { HeaderInterpolationProps, HeaderInterpolatedStyle } from '../types';
|
||||
import {
|
||||
StackHeaderInterpolationProps,
|
||||
StackHeaderInterpolatedStyle,
|
||||
} from '../types';
|
||||
|
||||
const { interpolate, add } = Animated;
|
||||
|
||||
@@ -11,7 +14,7 @@ export function forUIKit({
|
||||
current,
|
||||
next,
|
||||
layouts,
|
||||
}: HeaderInterpolationProps): HeaderInterpolatedStyle {
|
||||
}: StackHeaderInterpolationProps): StackHeaderInterpolatedStyle {
|
||||
const defaultOffset = 100;
|
||||
const leftSpacing = 27;
|
||||
|
||||
@@ -95,7 +98,7 @@ export function forUIKit({
|
||||
export function forFade({
|
||||
current,
|
||||
next,
|
||||
}: HeaderInterpolationProps): HeaderInterpolatedStyle {
|
||||
}: StackHeaderInterpolationProps): StackHeaderInterpolatedStyle {
|
||||
const progress = add(current.progress, next ? next.progress : 0);
|
||||
const opacity = interpolate(progress, {
|
||||
inputRange: [0, 1, 2],
|
||||
@@ -117,7 +120,7 @@ export function forStatic({
|
||||
current,
|
||||
next,
|
||||
layouts: { screen },
|
||||
}: HeaderInterpolationProps): HeaderInterpolatedStyle {
|
||||
}: StackHeaderInterpolationProps): StackHeaderInterpolatedStyle {
|
||||
const progress = add(current.progress, next ? next.progress : 0);
|
||||
const translateX = interpolate(progress, {
|
||||
inputRange: [0, 1, 2],
|
||||
@@ -136,6 +139,6 @@ export function forStatic({
|
||||
};
|
||||
}
|
||||
|
||||
export function forNoAnimation(): HeaderInterpolatedStyle {
|
||||
export function forNoAnimation(): StackHeaderInterpolatedStyle {
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -34,4 +34,16 @@ export { default as StackGestureContext } from './utils/StackGestureContext';
|
||||
/**
|
||||
* Types
|
||||
*/
|
||||
export { StackNavigationOptions, StackNavigationProp } from './types';
|
||||
export {
|
||||
StackNavigationOptions,
|
||||
StackNavigationProp,
|
||||
StackHeaderProps,
|
||||
StackHeaderLeftButtonProps,
|
||||
StackHeaderTitleProps,
|
||||
StackCardInterpolatedStyle,
|
||||
StackCardInterpolationProps,
|
||||
StackCardStyleInterpolator,
|
||||
StackHeaderInterpolatedStyle,
|
||||
StackHeaderInterpolationProps,
|
||||
StackHeaderStyleInterpolator,
|
||||
} from './types';
|
||||
|
||||
@@ -67,9 +67,7 @@ export type Layout = { width: number; height: number };
|
||||
|
||||
export type GestureDirection = 'horizontal' | 'vertical';
|
||||
|
||||
export type HeaderMode = 'float' | 'screen' | 'none';
|
||||
|
||||
export type HeaderScene<T> = {
|
||||
export type Scene<T> = {
|
||||
/**
|
||||
* Current route object,
|
||||
*/
|
||||
@@ -99,14 +97,16 @@ export type HeaderScene<T> = {
|
||||
};
|
||||
};
|
||||
|
||||
export type HeaderOptions = {
|
||||
export type StackHeaderMode = 'float' | 'screen' | 'none';
|
||||
|
||||
export type StackHeaderOptions = {
|
||||
/**
|
||||
* String or a function that returns a React Element to be used by the header.
|
||||
* Defaults to scene `title`.
|
||||
* It receives `allowFontScaling`, `onLayout`, `style` and `children` in the options object as an argument.
|
||||
* The title string is passed in `children`.
|
||||
*/
|
||||
headerTitle?: string | ((props: HeaderTitleProps) => React.ReactNode);
|
||||
headerTitle?: string | ((props: StackHeaderTitleProps) => React.ReactNode);
|
||||
/**
|
||||
* Style object for the title component.
|
||||
*/
|
||||
@@ -151,7 +151,7 @@ export type HeaderOptions = {
|
||||
* Function which returns a React Element to display on the left side of the header.
|
||||
* It receives a number of arguments when rendered (`onPress`, `label`, `labelStyle` and more.
|
||||
*/
|
||||
headerLeft?: (props: HeaderLeftButtonProps) => React.ReactNode;
|
||||
headerLeft?: (props: StackHeaderLeftButtonProps) => React.ReactNode;
|
||||
/**
|
||||
* Style object for the container of the `headerLeft` component, for example to add padding.
|
||||
*/
|
||||
@@ -169,7 +169,7 @@ export type HeaderOptions = {
|
||||
* It receives the `tintColor` in in the options object as an argument. object.
|
||||
* Defaults to Image component with a the default back icon image for the platform (a chevron on iOS and an arrow on Android).
|
||||
*/
|
||||
headerBackImage?: HeaderLeftButtonProps['backImage'];
|
||||
headerBackImage?: StackHeaderLeftButtonProps['backImage'];
|
||||
/**
|
||||
* Color for material ripple (Android >= 5.0 only).
|
||||
*/
|
||||
@@ -196,7 +196,7 @@ export type HeaderOptions = {
|
||||
headerTransparent?: boolean;
|
||||
};
|
||||
|
||||
export type HeaderProps = {
|
||||
export type StackHeaderProps = {
|
||||
/**
|
||||
* Mode of the header: `float` renders a single floating header across all screens,
|
||||
* `screen` renders separate headers for each screen.
|
||||
@@ -209,11 +209,11 @@ export type HeaderProps = {
|
||||
/**
|
||||
* Object representing the current scene, such as the route object and animation progress.
|
||||
*/
|
||||
scene: HeaderScene<Route<string>>;
|
||||
scene: Scene<Route<string>>;
|
||||
/**
|
||||
* Object representing the previous scene.
|
||||
*/
|
||||
previous?: HeaderScene<Route<string>>;
|
||||
previous?: Scene<Route<string>>;
|
||||
/**
|
||||
* Navigation prop for the header.
|
||||
*/
|
||||
@@ -221,7 +221,7 @@ export type HeaderProps = {
|
||||
/**
|
||||
* Interpolated styles for various elements in the header.
|
||||
*/
|
||||
styleInterpolator: HeaderStyleInterpolator;
|
||||
styleInterpolator: StackHeaderStyleInterpolator;
|
||||
};
|
||||
|
||||
export type StackDescriptor = Descriptor<
|
||||
@@ -235,7 +235,7 @@ export type StackDescriptorMap = {
|
||||
[key: string]: StackDescriptor;
|
||||
};
|
||||
|
||||
export type StackNavigationOptions = HeaderOptions &
|
||||
export type StackNavigationOptions = StackHeaderOptions &
|
||||
Partial<TransitionPreset> & {
|
||||
/**
|
||||
* String that can be displayed in the header as a fallback for `headerTitle`.
|
||||
@@ -245,7 +245,7 @@ export type StackNavigationOptions = HeaderOptions &
|
||||
* Function that given `HeaderProps` returns a React Element to display as a header.
|
||||
* Setting to `null` hides header.
|
||||
*/
|
||||
header?: null | ((props: HeaderProps) => React.ReactNode);
|
||||
header?: null | ((props: StackHeaderProps) => React.ReactNode);
|
||||
/**
|
||||
* Whether a shadow is visible for the card during transitions. Defaults to `true`.
|
||||
*/
|
||||
@@ -295,7 +295,7 @@ export type StackNavigationOptions = HeaderOptions &
|
||||
|
||||
export type StackNavigationConfig = {
|
||||
mode?: 'card' | 'modal';
|
||||
headerMode?: HeaderMode;
|
||||
headerMode?: StackHeaderMode;
|
||||
/**
|
||||
* If `false`, the keyboard will NOT automatically dismiss when navigating to a new screen.
|
||||
* Defaults to `true`.
|
||||
@@ -303,7 +303,7 @@ export type StackNavigationConfig = {
|
||||
keyboardHandlingEnabled?: boolean;
|
||||
};
|
||||
|
||||
export type HeaderLeftButtonProps = {
|
||||
export type StackHeaderLeftButtonProps = {
|
||||
/**
|
||||
* Whether the button is disabled.
|
||||
*/
|
||||
@@ -365,7 +365,7 @@ export type HeaderLeftButtonProps = {
|
||||
canGoBack?: boolean;
|
||||
};
|
||||
|
||||
export type HeaderTitleProps = {
|
||||
export type StackHeaderTitleProps = {
|
||||
/**
|
||||
* Callback to trigger when the size of the title element changes.
|
||||
*/
|
||||
@@ -408,7 +408,7 @@ export type TransitionSpec =
|
||||
| { animation: 'spring'; config: SpringConfig }
|
||||
| { animation: 'timing'; config: TimingConfig };
|
||||
|
||||
export type CardInterpolationProps = {
|
||||
export type StackCardInterpolationProps = {
|
||||
/**
|
||||
* Values for the current screen.
|
||||
*/
|
||||
@@ -447,7 +447,7 @@ export type CardInterpolationProps = {
|
||||
};
|
||||
};
|
||||
|
||||
export type CardInterpolatedStyle = {
|
||||
export type StackCardInterpolatedStyle = {
|
||||
/**
|
||||
* Interpolated style for the container view wrapping the card.
|
||||
*/
|
||||
@@ -466,11 +466,11 @@ export type CardInterpolatedStyle = {
|
||||
shadowStyle?: any;
|
||||
};
|
||||
|
||||
export type CardStyleInterpolator = (
|
||||
props: CardInterpolationProps
|
||||
) => CardInterpolatedStyle;
|
||||
export type StackCardStyleInterpolator = (
|
||||
props: StackCardInterpolationProps
|
||||
) => StackCardInterpolatedStyle;
|
||||
|
||||
export type HeaderInterpolationProps = {
|
||||
export type StackHeaderInterpolationProps = {
|
||||
/**
|
||||
* Values for the current screen (the screen which owns this header).
|
||||
*/
|
||||
@@ -509,7 +509,7 @@ export type HeaderInterpolationProps = {
|
||||
};
|
||||
};
|
||||
|
||||
export type HeaderInterpolatedStyle = {
|
||||
export type StackHeaderInterpolatedStyle = {
|
||||
/**
|
||||
* Interpolated style for the label of the left button (back button label).
|
||||
*/
|
||||
@@ -532,9 +532,9 @@ export type HeaderInterpolatedStyle = {
|
||||
backgroundStyle?: any;
|
||||
};
|
||||
|
||||
export type HeaderStyleInterpolator = (
|
||||
props: HeaderInterpolationProps
|
||||
) => HeaderInterpolatedStyle;
|
||||
export type StackHeaderStyleInterpolator = (
|
||||
props: StackHeaderInterpolationProps
|
||||
) => StackHeaderInterpolatedStyle;
|
||||
|
||||
export type TransitionPreset = {
|
||||
/**
|
||||
@@ -557,9 +557,9 @@ export type TransitionPreset = {
|
||||
/**
|
||||
* Function which specifies interpolated styles for various parts of the card, e.g. the overlay, shadow etc.
|
||||
*/
|
||||
cardStyleInterpolator: CardStyleInterpolator;
|
||||
cardStyleInterpolator: StackCardStyleInterpolator;
|
||||
/**
|
||||
* Function which specifies interpolated styles for various parts of the header, e.g. the title, left button etc.
|
||||
*/
|
||||
headerStyleInterpolator: HeaderStyleInterpolator;
|
||||
headerStyleInterpolator: StackHeaderStyleInterpolator;
|
||||
};
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import * as React from 'react';
|
||||
import { StackActions } from '@react-navigation/routers';
|
||||
import HeaderSegment from './HeaderSegment';
|
||||
import { HeaderProps, HeaderTitleProps } from '../../types';
|
||||
import { StackHeaderProps, StackHeaderTitleProps } from '../../types';
|
||||
import HeaderTitle from './HeaderTitle';
|
||||
|
||||
export default React.memo(function Header(props: HeaderProps) {
|
||||
export default React.memo(function Header(props: StackHeaderProps) {
|
||||
const { scene, previous, layout, navigation, styleInterpolator } = props;
|
||||
const { options } = scene.descriptor;
|
||||
const title =
|
||||
@@ -41,7 +41,7 @@ export default React.memo(function Header(props: HeaderProps) {
|
||||
leftLabel={leftLabel}
|
||||
headerTitle={
|
||||
typeof options.headerTitle !== 'function'
|
||||
? (props: HeaderTitleProps) => <HeaderTitle {...props} />
|
||||
? (props: StackHeaderTitleProps) => <HeaderTitle {...props} />
|
||||
: options.headerTitle
|
||||
}
|
||||
onGoBack={
|
||||
|
||||
@@ -10,9 +10,9 @@ import {
|
||||
import Animated from 'react-native-reanimated';
|
||||
import MaskedView from '../MaskedView';
|
||||
import TouchableItem from '../TouchableItem';
|
||||
import { HeaderLeftButtonProps } from '../../types';
|
||||
import { StackHeaderLeftButtonProps } from '../../types';
|
||||
|
||||
type Props = HeaderLeftButtonProps & {
|
||||
type Props = StackHeaderLeftButtonProps & {
|
||||
tintColor: string;
|
||||
};
|
||||
|
||||
|
||||
@@ -11,15 +11,15 @@ import Header from './Header';
|
||||
import { forStatic } from '../../TransitionConfigs/HeaderStyleInterpolators';
|
||||
import {
|
||||
Layout,
|
||||
HeaderScene,
|
||||
HeaderStyleInterpolator,
|
||||
Scene,
|
||||
StackHeaderStyleInterpolator,
|
||||
StackNavigationProp,
|
||||
} from '../../types';
|
||||
|
||||
export type Props = {
|
||||
mode: 'float' | 'screen';
|
||||
layout: Layout;
|
||||
scenes: Array<HeaderScene<Route<string>> | undefined>;
|
||||
scenes: Array<Scene<Route<string>> | undefined>;
|
||||
state: StackNavigationState;
|
||||
getPreviousRoute: (props: {
|
||||
route: Route<string>;
|
||||
@@ -28,7 +28,7 @@ export type Props = {
|
||||
route: Route<string>;
|
||||
height: number;
|
||||
}) => void;
|
||||
styleInterpolator: HeaderStyleInterpolator;
|
||||
styleInterpolator: StackHeaderStyleInterpolator;
|
||||
style?: StyleProp<ViewStyle>;
|
||||
};
|
||||
|
||||
|
||||
@@ -14,11 +14,11 @@ import getStatusBarHeight from '../../utils/getStatusBarHeight';
|
||||
import memoize from '../../utils/memoize';
|
||||
import {
|
||||
Layout,
|
||||
HeaderStyleInterpolator,
|
||||
HeaderLeftButtonProps,
|
||||
HeaderTitleProps,
|
||||
HeaderOptions,
|
||||
HeaderScene,
|
||||
StackHeaderStyleInterpolator,
|
||||
StackHeaderLeftButtonProps,
|
||||
StackHeaderTitleProps,
|
||||
StackHeaderOptions,
|
||||
Scene,
|
||||
} from '../../types';
|
||||
|
||||
export type Scene<T> = {
|
||||
@@ -26,14 +26,14 @@ export type Scene<T> = {
|
||||
progress: Animated.Node<number>;
|
||||
};
|
||||
|
||||
type Props = HeaderOptions & {
|
||||
headerTitle: (props: HeaderTitleProps) => React.ReactNode;
|
||||
type Props = StackHeaderOptions & {
|
||||
headerTitle: (props: StackHeaderTitleProps) => React.ReactNode;
|
||||
layout: Layout;
|
||||
onGoBack?: () => void;
|
||||
title?: string;
|
||||
leftLabel?: string;
|
||||
scene: HeaderScene<Route<string>>;
|
||||
styleInterpolator: HeaderStyleInterpolator;
|
||||
scene: Scene<Route<string>>;
|
||||
styleInterpolator: StackHeaderStyleInterpolator;
|
||||
};
|
||||
|
||||
type State = {
|
||||
@@ -113,7 +113,7 @@ export default class HeaderSegment extends React.Component<Props, State> {
|
||||
|
||||
private getInterpolatedStyle = memoize(
|
||||
(
|
||||
styleInterpolator: HeaderStyleInterpolator,
|
||||
styleInterpolator: StackHeaderStyleInterpolator,
|
||||
layout: Layout,
|
||||
current: Animated.Node<number>,
|
||||
next: Animated.Node<number> | undefined,
|
||||
@@ -140,7 +140,7 @@ export default class HeaderSegment extends React.Component<Props, State> {
|
||||
onGoBack,
|
||||
headerTitle,
|
||||
headerLeft: left = onGoBack
|
||||
? (props: HeaderLeftButtonProps) => <HeaderBackButton {...props} />
|
||||
? (props: StackHeaderLeftButtonProps) => <HeaderBackButton {...props} />
|
||||
: undefined,
|
||||
// @ts-ignore
|
||||
headerStatusBarHeight = getStatusBarHeight(layout.width > layout.height),
|
||||
|
||||
@@ -16,7 +16,7 @@ import {
|
||||
} from 'react-native-gesture-handler';
|
||||
import {
|
||||
TransitionSpec,
|
||||
CardStyleInterpolator,
|
||||
StackCardStyleInterpolator,
|
||||
Layout,
|
||||
SpringConfig,
|
||||
TimingConfig,
|
||||
@@ -52,7 +52,7 @@ type Props = ViewProps & {
|
||||
open: TransitionSpec;
|
||||
close: TransitionSpec;
|
||||
};
|
||||
styleInterpolator: CardStyleInterpolator;
|
||||
styleInterpolator: StackCardStyleInterpolator;
|
||||
containerStyle?: StyleProp<ViewStyle>;
|
||||
contentStyle?: StyleProp<ViewStyle>;
|
||||
};
|
||||
@@ -658,7 +658,7 @@ export default class Card extends React.Component<Props> {
|
||||
// Changing it during an animations can result in unexpected results
|
||||
private getInterpolatedStyle = memoize(
|
||||
(
|
||||
styleInterpolator: CardStyleInterpolator,
|
||||
styleInterpolator: StackCardStyleInterpolator,
|
||||
index: number,
|
||||
current: Animated.Node<number>,
|
||||
next: Animated.Node<number> | undefined,
|
||||
|
||||
@@ -23,8 +23,8 @@ import {
|
||||
import { forNoAnimation } from '../../TransitionConfigs/HeaderStyleInterpolators';
|
||||
import {
|
||||
Layout,
|
||||
HeaderMode,
|
||||
HeaderScene,
|
||||
StackHeaderMode,
|
||||
Scene,
|
||||
StackDescriptorMap,
|
||||
StackNavigationOptions,
|
||||
StackNavigationHelpers,
|
||||
@@ -51,7 +51,7 @@ type Props = {
|
||||
getGesturesEnabled: (props: { route: Route<string> }) => boolean;
|
||||
renderHeader: (props: HeaderContainerProps) => React.ReactNode;
|
||||
renderScene: (props: { route: Route<string> }) => React.ReactNode;
|
||||
headerMode: HeaderMode;
|
||||
headerMode: StackHeaderMode;
|
||||
onPageChangeStart?: () => void;
|
||||
onPageChangeConfirm?: () => void;
|
||||
onPageChangeCancel?: () => void;
|
||||
@@ -60,7 +60,7 @@ type Props = {
|
||||
type State = {
|
||||
routes: Route<string>[];
|
||||
descriptors: StackDescriptorMap;
|
||||
scenes: HeaderScene<Route<string>>[];
|
||||
scenes: Scene<Route<string>>[];
|
||||
progress: ProgressValues;
|
||||
layout: Layout;
|
||||
floatingHeaderHeights: { [key: string]: number };
|
||||
|
||||
@@ -7,9 +7,9 @@ import { Props as HeaderContainerProps } from '../Header/HeaderContainer';
|
||||
import Card from './Card';
|
||||
import {
|
||||
StackNavigationHelpers,
|
||||
HeaderScene,
|
||||
Scene,
|
||||
Layout,
|
||||
HeaderMode,
|
||||
StackHeaderMode,
|
||||
TransitionPreset,
|
||||
} from '../../types';
|
||||
|
||||
@@ -20,8 +20,8 @@ type Props = TransitionPreset & {
|
||||
closing: boolean;
|
||||
layout: Layout;
|
||||
current: Animated.Value<number>;
|
||||
previousScene?: HeaderScene<Route<string>>;
|
||||
scene: HeaderScene<Route<string>>;
|
||||
previousScene?: Scene<Route<string>>;
|
||||
scene: Scene<Route<string>>;
|
||||
state: StackNavigationState;
|
||||
navigation: StackNavigationHelpers;
|
||||
cardTransparent?: boolean;
|
||||
@@ -49,7 +49,7 @@ type Props = TransitionPreset & {
|
||||
vertical?: number;
|
||||
horizontal?: number;
|
||||
};
|
||||
headerMode: HeaderMode;
|
||||
headerMode: StackHeaderMode;
|
||||
headerTransparent?: boolean;
|
||||
floatingHeaderHeight: number;
|
||||
hasCustomHeader: boolean;
|
||||
|
||||
Reference in New Issue
Block a user