Closed liaojh554 closed 2 months ago
本次升级并没有对SwipeAction做出样式之类的改变,请贴出相关代码
SwipeAction的属性定义和文档都不一样了,我从3.0升上来发现样式都失效了,这个组件重构了?
import React from 'react';
import { Animated, StyleProp, TextStyle, ViewStyle } from 'react-native';
import { PanGestureHandlerProps } from 'react-native-gesture-handler';
import Swipeable from 'react-native-gesture-handler/Swipeable';
declare type SwipeableExcludes = Exclude<keyof PanGestureHandlerProps, 'onGestureEvent' | 'onHandlerStateChange'>;
interface SwipeableProps extends Pick<PanGestureHandlerProps, SwipeableExcludes> {
enableTrackpadTwoFingerGesture?: boolean;
friction?: number;
leftThreshold?: number;
rightThreshold?: number;
overshootLeft?: boolean;
overshootRight?: boolean;
overshootFriction?: number;
onSwipeableLeftOpen?: () => void;
onSwipeableRightOpen?: () => void;
onSwipeableOpen?: () => void;
onSwipeableClose?: () => void;
onSwipeableLeftWillOpen?: () => void;
onSwipeableRightWillOpen?: () => void;
onSwipeableWillOpen?: () => void;
onSwipeableWillClose?: () => void;
/**
*
* This map describes the values to use as inputRange for extra interpolation:
* AnimatedValue: [startValue, endValue]
*
* progressAnimatedValue: [0, 1]
* dragAnimatedValue: [0, +]
*
* To support `rtl` flexbox layouts use `flexDirection` styling.
* */
renderLeftActions?: (progressAnimatedValue: Animated.AnimatedInterpolation, dragAnimatedValue: Animated.AnimatedInterpolation) => React.ReactNode;
/**
*
* This map describes the values to use as inputRange for extra interpolation:
* AnimatedValue: [startValue, endValue]
*
* progressAnimatedValue: [0, 1]
* dragAnimatedValue: [0, -]
*
* To support `rtl` flexbox layouts use `flexDirection` styling.
* */
renderRightActions?: (progressAnimatedValue: Animated.AnimatedInterpolation, dragAnimatedValue: Animated.AnimatedInterpolation) => React.ReactNode;
useNativeAnimations?: boolean;
animationOptions?: Record<string, unknown>;
containerStyle?: StyleProp<ViewStyle>;
childrenContainerStyle?: StyleProp<ViewStyle>;
}
export interface SwipeActionProps extends SwipeableProps {
left?: SwipeoutButtonProps[];
right?: SwipeoutButtonProps[];
buttonWidth?: number;
}
export interface SwipeoutButtonProps {
style?: StyleProp<TextStyle>;
backgroundColor?: string;
color?: string;
text?: React.ReactNode;
disabled?: boolean;
onPress?(): void;
}
declare class SwipeAction extends React.Component<SwipeActionProps> {
swipeableRow?: Swipeable;
render(): JSX.Element;
updateRef: (ref: Swipeable) => void;
close: () => void;
renderActions: (progress: Animated.AnimatedInterpolation, _dragAnimatedValue: Animated.AnimatedInterpolation, isLeft?: boolean) => JSX.Element | null;
}
export default SwipeAction;
我这连滑都滑不动了
请问这个问题解决了吗
我这 安卓上 按钮的文字不展示,iOS上正常
fixed in 5.2.1
Reproduction link
https://github.com/ant-design/ant-design-mobile-rn
Steps to reproduce
ant-design-mobile-rn更新到v4.2版本
What is expected?
与v4.1版本下的SwipeAction表现一致
What is actually happening?
ant-design-mobile-rn更新到v4.2版本后,SwipeAction的Props失效,样式变形