Files
modernjs/chapter12/storybook/centered.js
T
Federico Kereki 4133bd644c Storybook working
2018-09-23 01:55:14 -03:00

26 lines
578 B
JavaScript

/* @flow */
import React from "react";
import { View, StyleSheet } from "react-native";
import PropTypes from "prop-types";
const centerColor = "white";
const styles = StyleSheet.create({
centered: {
flex: 1,
backgroundColor: centerColor,
alignItems: "center",
justifyContent: "center"
}
});
export class Centered extends React.Component<{ children: node }> {
static propTypes = {
children: PropTypes.node.isRequired
};
render() {
return <View style={styles.centered}>{this.props.children}</View>;
}
}