Last active
April 18, 2020 16:05
-
-
Save renielsalvador/84c6ccd35adabde2580d3b371035aaa5 to your computer and use it in GitHub Desktop.
Sample type hinting with props children and style
This file contains 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 characters
import React, {ReactNode} from 'react'; | |
import {StyleSheet} from 'react-native'; | |
import {Container, RnViewStyleProp} from 'native-base'; | |
interface Props { | |
children: ReactNode; | |
style?: RnViewStyleProp | Array<RnViewStyleProp>; | |
} | |
export default ({children, style}: Props) => ( | |
<Container style={[styles.contentWrapper, style]}>{children}</Container> | |
); | |
const styles = StyleSheet.create({ | |
contentWrapper: { | |
backgroundColor: '#f3f3f3', | |
}, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment