rn-base-components
Version:
Easy to create a component
22 lines (18 loc) • 594 B
JavaScript
import React, {memo} from 'react';
import styled from 'styled-components/native';
import AppView from './AppView';
import KEY from './Key';
function AppButton(props) {
const {KEY_WORD_STYLE} = KEY;
const {children, onPressIn = () => {}, onPress = () => {}, hitSlop} = props;
return (
<AppButtonComponent
onPressIn={onPressIn}
onPress={onPress}
hitSlop={hitSlop && KEY_WORD_STYLE.hitSlop}>
<AppView {...props}>{children}</AppView>
</AppButtonComponent>
);
}
export default memo(AppButton);
const AppButtonComponent = styled.TouchableWithoutFeedback``;