-
-
Save statianzo/a6b51e5b1768cd63892950af6314c03a to your computer and use it in GitHub Desktop.
Revisions
-
ssomnoremac revised this gist
Mar 23, 2017 . 1 changed file with 12 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,11 +14,18 @@ import { let Styled = {} const StyledComponent = (Component) => (styles) => (props) => { const { styles: inlineStyles, children, ...otherProps, } = props return( <Component style={[styles, inlineStyles]} {...otherProps}> {children} </Component> ) }; Styled.View = StyledComponent(View) Styled.Image = StyledComponent(Image) -
ssomnoremac revised this gist
Mar 23, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -15,7 +15,7 @@ import { let Styled = {} const StyledComponent = (Component) => (styles) => (props) => ( <Component style={[styles, props.styles]} {...props}> {props.children} </Component> ); -
ssomnoremac created this gist
Mar 23, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,33 @@ import React from 'react'; import { View, Image, ListView, ScrollView, Text, TouchableHighlight, TouchableNativeFeedback, TouchableOpacity, TouchableWithoutFeedback, } from 'react-native' let Styled = {} const StyledComponent = (Component) => (styles) => (props) => ( <Component style={styles} {...props}> {props.children} </Component> ); Styled.View = StyledComponent(View) Styled.Image = StyledComponent(Image) Styled.ListView = StyledComponent(ListView) Styled.ScrollView = StyledComponent(ScrollView) Styled.Text = StyledComponent(Text) Styled.TouchableHighlight = StyledComponent(TouchableHighlight) Styled.TouchableNativeFeedback = StyledComponent(TouchableNativeFeedback) Styled.TouchableOpacity = StyledComponent(TouchableOpacity) Styled.TouchableWithoutFeedback = StyledComponent(TouchableWithoutFeedback) export default Styled