swipeout
swipeout copied to clipboard
Missing custom component support
In src/Swipeout.tsx:
renderCustomButton(button) {
const buttonStyle = button.style || {};
const bgColor = buttonStyle.backgroundColor || 'transparent';
const Component = (
<View
style={{
flex: 1, justifyContent: 'center', alignItems: 'center', backgroundColor: bgColor,
}}
>
{React.isValidElement(button.text) ? button.text : (
<Text style={[button.style, { textAlign: 'center' }]}>
{button.text}
</Text>
)}
</View>
);
return {
text: button.text || 'Click',
onPress: button.onPress,
type: 'default',
component: Component,
backgroundColor: 'transparent',
color: '#999',
disabled: false,
};
}
button.component is simply ignored but the parameter exists in react-native-swiperout, please add the parameter so we can use custom component like custom icon in swipeout.