concept flexwrap in category react native
appears as: flexWrap

This is an excerpt from Manning's book React Native in Action.
You’ve already seen flexbox used in many of the examples. It’s powerful and makes laying out items so much easier than alternative methods that it’s difficult not to use it. You’ll benefit greatly by taking time to understand the material in this section. Here are the alignment properties used to control the flexbox layout:
flex,flexDirection,justifyContent,alignItems,alignSelf, andflexWrap.
Listing 5.10 Example of how
flexWrapvalues affect layoutimport React, { Component } from 'react'; import { StyleSheet, Text, View} from 'react-native'; export default class App extends Component<{}> { render() { return ( <View style={styles.container}> <NoWrapContainer> #1 <Example>A nowrap</Example> <Example>1</Example> <Example>2</Example> <Example>3</Example> <Example>4</Example> </NoWrapContainer> <WrapContainer> #2 <Example>B wrap</Example> <Example>1</Example> <Example>2</Example> <Example>3</Example> <Example>4</Example> </WrapContainer> </View> ); } } const NoWrapContainer = (props) => ( <View style={[styles.noWrapContainer,props.style]}> #3 {props.children} </View> ); const WrapContainer = (props) => ( <View style={[styles.wrapContainer,props.style]}> #4 {props.children} </View> ); const Example = (props) => ( <View style={[styles.example,props.style]}> <Text> {props.children} </Text> </View> ); const styles = StyleSheet.create({ container: { marginTop: 150, flex: 1 }, noWrapContainer: { backgroundColor: '#ededed', flexDirection: 'row', #5 flexWrap: 'nowrap', borderWidth: 1, margin: 10 }, wrapContainer: { backgroundColor: '#ededed', flexDirection: 'row', #6 flexWrap: 'wrap', borderWidth: 1, margin: 10 }, example: { width: 100, height: 100, margin: 5, backgroundColor: '#666666' }, }); #1 flexWrap is set to nowrap: the squares overflow off the screen. #2 flexWrap is set to wrap: the row of squares wraps around to start a new line. #3 Uses the noWrapContainer style for the first example #4 Uses the wrapContainer style for the second example #5 Sets flexDirection to row and flexWrap to nowrap #6 Sets flexDirection to row and flexWrap to wrap !@%STYLE%@! {"css":"{\"css\": \"font-weight: bold;\"}","target":"[[{\"line\":27,\"ch\":18},{\"line\":27,\"ch\":40}],[{\"line\":33,\"ch\":18},{\"line\":33,\"ch\":38}],[{\"line\":53,\"ch\":8},{\"line\":53,\"ch\":29}],[{\"line\":60,\"ch\":8},{\"line\":60,\"ch\":29}],[{\"line\":54,\"ch\":8},{\"line\":54,\"ch\":27}],[{\"line\":53,\"ch\":8},{\"line\":53,\"ch\":29}],[{\"line\":60,\"ch\":8},{\"line\":60,\"ch\":29}],[{\"line\":61,\"ch\":8},{\"line\":61,\"ch\":25}]]"} !@%STYLE%@!