UNPKG

arm-components

Version:

components for react-native

37 lines (34 loc) 708 B
import React, { Component } from 'react'; import { View } from 'react-native'; export default class Row extends Component{ constructor(props){ super(props); this.state = { style: this.props.style, children: this.props.children, onLayout: this.props.onLayout }; } componentWillReceiveProps(newProps){ this.setState({ style: newProps.style, children: newProps.children }); } render(){ let { style, children, onLayout } = this.state; return( <View onLayout={onLayout} style={[{ display: 'flex', flexDirection: 'row', flexWrap: 'wrap', width: '100%' }, style]} > { children } </View> ) } }