mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-04-26 23:06:03 +08:00
chore: upgrade depenendecies
This commit is contained in:
5
packages/stack/src/vendor/types.tsx
vendored
5
packages/stack/src/vendor/types.tsx
vendored
@@ -21,6 +21,7 @@ import type {
|
||||
} from 'react-navigation';
|
||||
|
||||
// @ts-ignore
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
export type Route<T extends string> = NavigationRoute;
|
||||
|
||||
export type NavigationStackState = NavigationState;
|
||||
@@ -288,7 +289,9 @@ export type StackNavigationOptions = StackHeaderOptions &
|
||||
/**
|
||||
* Function that returns a React Element to display as a overlay for the card.
|
||||
*/
|
||||
cardOverlay?: (props: { style: StyleProp<ViewStyle> }) => React.ReactNode;
|
||||
cardOverlay?: (props: {
|
||||
style: Animated.WithAnimatedValue<StyleProp<ViewStyle>>;
|
||||
}) => React.ReactNode;
|
||||
/**
|
||||
* Style object for the card in stack.
|
||||
* You can provide a custom background color to use instead of the default background here.
|
||||
|
||||
@@ -39,7 +39,6 @@ export default class BorderlessButton extends React.Component<Props> {
|
||||
const { children, style, enabled, ...rest } = this.props;
|
||||
|
||||
return (
|
||||
// @ts-expect-error: the Animated.createAnimatedComponent types don't work properly
|
||||
<AnimatedBaseButton
|
||||
{...rest}
|
||||
onActiveStateChange={this.handleActiveStateChange}
|
||||
|
||||
@@ -314,8 +314,10 @@ export default class HeaderSegment extends React.Component<Props, State> {
|
||||
style={[StyleSheet.absoluteFill, { zIndex: 0 }, backgroundStyle]}
|
||||
>
|
||||
{headerBackground ? (
|
||||
// @ts-ignore
|
||||
headerBackground({ style: safeStyles })
|
||||
) : headerTransparent ? null : (
|
||||
// @ts-ignore
|
||||
<HeaderBackground style={safeStyles} />
|
||||
)}
|
||||
</Animated.View>
|
||||
|
||||
@@ -17,7 +17,7 @@ export default class KeyboardManager extends React.Component<Props> {
|
||||
|
||||
// Numeric id of the previously focused text input
|
||||
// When a gesture didn't change the tab, we can restore the focused input with this
|
||||
private previouslyFocusedTextInput: number | null = null;
|
||||
private previouslyFocusedTextInput: any = null;
|
||||
private startTimestamp: number = 0;
|
||||
private keyboardTimeout: any;
|
||||
|
||||
@@ -35,10 +35,8 @@ export default class KeyboardManager extends React.Component<Props> {
|
||||
|
||||
this.clearKeyboardTimeout();
|
||||
|
||||
// @ts-expect-error: currentlyFocusedInput is pretty new, so not in the type definitions
|
||||
const input = TextInput.State.currentlyFocusedInput
|
||||
? // @ts-expect-error
|
||||
TextInput.State.currentlyFocusedInput()
|
||||
const input: any = TextInput.State.currentlyFocusedInput
|
||||
? TextInput.State.currentlyFocusedInput()
|
||||
: TextInput.State.currentlyFocusedField();
|
||||
|
||||
// When a page change begins, blur the currently focused input
|
||||
|
||||
1
packages/stack/src/vendor/views/Screens.tsx
vendored
1
packages/stack/src/vendor/views/Screens.tsx
vendored
@@ -58,7 +58,6 @@ export const MaybeScreen = ({
|
||||
children: React.ReactNode;
|
||||
}) => {
|
||||
if (enabled && Platform.OS === 'web') {
|
||||
// @ts-expect-error: the Animated.createAnimatedComponent types don't work properly
|
||||
return <AnimatedWebScreen active={active} {...rest} />;
|
||||
}
|
||||
|
||||
|
||||
@@ -508,9 +508,10 @@ export default class Card extends React.Component<Props> {
|
||||
: undefined;
|
||||
|
||||
const { backgroundColor } = StyleSheet.flatten(contentStyle || {});
|
||||
const isTransparent = backgroundColor
|
||||
? Color(backgroundColor).alpha() === 0
|
||||
: false;
|
||||
const isTransparent =
|
||||
typeof backgroundColor === 'string'
|
||||
? Color(backgroundColor).alpha() === 0
|
||||
: false;
|
||||
|
||||
return (
|
||||
<CardAnimationContext.Provider value={animationContext}>
|
||||
|
||||
@@ -27,7 +27,9 @@ type Props = TransitionPreset & {
|
||||
safeAreaInsetRight: number;
|
||||
safeAreaInsetBottom: number;
|
||||
safeAreaInsetLeft: number;
|
||||
cardOverlay?: (props: { style: StyleProp<ViewStyle> }) => React.ReactNode;
|
||||
cardOverlay?: (props: {
|
||||
style: Animated.WithAnimatedValue<StyleProp<ViewStyle>>;
|
||||
}) => React.ReactNode;
|
||||
cardOverlayEnabled?: boolean;
|
||||
cardShadowEnabled?: boolean;
|
||||
cardStyle?: StyleProp<ViewStyle>;
|
||||
|
||||
Reference in New Issue
Block a user