concept item in category react native

appears as: items, items, The items, n item, item, The item, item
React Native in Action

This is an excerpt from Manning's book React Native in Action.

Figure 1.2 shows how the design in figure 1.1 could be broken up as I just described. The names can be whatever makes sense to you. Some of the items are grouped together—I logically separated the items individually and grouped components conceptually.

Flexbox is a layout implementation that React Native uses to provide an efficient way for users to create UIs and control positioning. The React Native flexbox implementation is based on the W3C flexbox web specification but doesn’t share 100% of the API. It aims to give you an easy way to reason about, align, and distribute space among items in a layout, even when their size isn’t known or is dynamic.

Listing 5.5 Flex views with 1:1 ratio, 1:2, and 1:3 ratios
…
render() {
  return (
    <View style={styles.container}>
      <View style={[styles.flexContainer]}>
        <Example style={[{flex: 1},styles.darkgrey]}>A 50%</Example>    #1  
        <Example style={[{flex: 1}]}>B 50%</Example>
      </View>
      <View style={[styles.flexContainer]}>    #2  
        <Example style={[{flex: 1},styles.darkgrey]}>C 33%</Example>
        <Example style={{flex: 2}}>D 66%</Example>
      </View>
      <View style={[styles.flexContainer]}>    #3  
        <Example style={[{flex: 1},styles.darkgrey]}>E 25%</Example>
        <Example style={{flex: 3}}>F 75%</Example>
      </View>
    </View>
  );
}
…

#1   The items have the same flex value, so they take up the same amount of space in their parent container.
#2   C takes up 1/3 of the total space, and D takes up 2/3 of the total space.
#3   E takes up 1/4 of the total space, and F takes up 3/4 of the total space.

Figure 5.17 The same example as in figure 5.16, but with flexDirection set to 'row'. Now the items take up space horizontally within the row rather than vertically within the column.

c05_17.eps