Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- export const ButtonWithComponent = (Comp) => props =>
- <TouchableOpacity
- onPress={props.onPress}
- style={{
- paddingHorizontal: 10,
- flexDirection: 'row',
- justifyContent: 'flex-end',
- alignItems: 'center'
- }}
- hitSlop={{ left: 5, right: 5, top: 5, bottom: 5 }}
- >
- <Comp />
- </TouchableOpacity>;
- const PencilButton = ButtonWithComponent(
- <Icon name="pencil" color={APP_MAIN_COLOR} size={30} type="entypo" />
- );
- class myClass extends Component {
- ...
- render() {
- return (
- <PencilButton />
- );
- }
- }
Add Comment
Please, Sign In to add comment