mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-04-28 20:35:19 +08:00
chore: migrate to monorepo
This commit is contained in:
@@ -1,12 +1,8 @@
|
||||
/**
|
||||
* Navigators
|
||||
*/
|
||||
export {
|
||||
default as createBottomTabNavigator,
|
||||
} from './navigators/createBottomTabNavigator';
|
||||
export {
|
||||
default as createMaterialTopTabNavigator,
|
||||
} from './navigators/createMaterialTopTabNavigator';
|
||||
export { default as createBottomTabNavigator } from './navigators/createBottomTabNavigator';
|
||||
export { default as createMaterialTopTabNavigator } from './navigators/createMaterialTopTabNavigator';
|
||||
|
||||
/**
|
||||
* Views
|
||||
|
||||
@@ -3,11 +3,10 @@ import {
|
||||
View,
|
||||
StyleSheet,
|
||||
AccessibilityRole,
|
||||
AccessibilityState,
|
||||
AccessibilityStates,
|
||||
} from 'react-native';
|
||||
import { NavigationRoute } from 'react-navigation';
|
||||
|
||||
// eslint-disable-next-line import/no-unresolved
|
||||
import { ScreenContainer } from 'react-native-screens';
|
||||
|
||||
import createTabNavigator, {
|
||||
@@ -36,7 +35,7 @@ type Props = NavigationViewProps &
|
||||
getAccessibilityStates: (props: {
|
||||
route: NavigationRoute;
|
||||
focused: boolean;
|
||||
}) => AccessibilityState[];
|
||||
}) => AccessibilityStates[];
|
||||
navigation: NavigationTabProp;
|
||||
descriptors: SceneDescriptorMap;
|
||||
screenProps?: unknown;
|
||||
@@ -54,7 +53,7 @@ class TabNavigationView extends React.PureComponent<Props, State> {
|
||||
focused,
|
||||
}: {
|
||||
focused: boolean;
|
||||
}): AccessibilityState[] => (focused ? ['selected'] : []),
|
||||
}): AccessibilityStates[] => (focused ? ['selected'] : []),
|
||||
};
|
||||
|
||||
static getDerivedStateFromProps(nextProps: Props, prevState: State) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import * as React from 'react';
|
||||
import {
|
||||
AccessibilityRole,
|
||||
AccessibilityState,
|
||||
AccessibilityStates,
|
||||
StyleProp,
|
||||
TextStyle,
|
||||
ViewStyle,
|
||||
@@ -106,7 +106,7 @@ export type ButtonComponentProps = {
|
||||
testID?: string;
|
||||
accessibilityLabel?: string;
|
||||
accessibilityRole?: AccessibilityRole;
|
||||
accessibilityStates?: AccessibilityState[];
|
||||
accessibilityStates?: AccessibilityStates[];
|
||||
style?: StyleProp<ViewStyle>;
|
||||
};
|
||||
|
||||
@@ -123,7 +123,7 @@ export type BottomTabBarProps = BottomTabBarOptions & {
|
||||
getAccessibilityStates: (props: {
|
||||
route: NavigationRoute;
|
||||
focused: boolean;
|
||||
}) => AccessibilityState[];
|
||||
}) => AccessibilityStates[];
|
||||
getButtonComponent: (props: {
|
||||
route: NavigationRoute;
|
||||
}) => React.ComponentType<ButtonComponentProps> | undefined;
|
||||
|
||||
@@ -144,8 +144,7 @@ class TabBarBottom extends React.Component<BottomTabBarProps, State> {
|
||||
const defaultKeyboardAnimationConfig =
|
||||
DEFAULT_KEYBOARD_ANIMATION_CONFIG[type];
|
||||
const keyboardAnimationConfig =
|
||||
(keyboardHidesTabBarAnimationConfig &&
|
||||
keyboardHidesTabBarAnimationConfig[type]) ||
|
||||
keyboardHidesTabBarAnimationConfig?.[type] ||
|
||||
defaultKeyboardAnimationConfig;
|
||||
|
||||
// merge config only `timing` animation
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import * as React from 'react';
|
||||
import { Platform, StyleSheet, View } from 'react-native';
|
||||
|
||||
// eslint-disable-next-line import/no-unresolved
|
||||
import { Screen, screensEnabled } from 'react-native-screens';
|
||||
|
||||
type Props = {
|
||||
@@ -14,7 +13,7 @@ const FAR_FAR_AWAY = 3000; // this should be big enough to move the whole view o
|
||||
|
||||
export default class ResourceSavingScene extends React.Component<Props> {
|
||||
render() {
|
||||
if (screensEnabled && screensEnabled()) {
|
||||
if (screensEnabled?.()) {
|
||||
const { isVisible, ...rest } = this.props;
|
||||
// @ts-ignore
|
||||
return <Screen active={isVisible ? 1 : 0} {...rest} />;
|
||||
|
||||
Reference in New Issue
Block a user