Skip to content

Instantly share code, notes, and snippets.

@renielsalvador
Last active April 18, 2020 16:05
Show Gist options
  • Save renielsalvador/84c6ccd35adabde2580d3b371035aaa5 to your computer and use it in GitHub Desktop.
Save renielsalvador/84c6ccd35adabde2580d3b371035aaa5 to your computer and use it in GitHub Desktop.
Sample type hinting with props children and style
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