Check out example codes for "flex wrap css". It will help you in understanding the concepts better.

Code Example 1

<!DOCTYPE html> 
<html> 
<head> 
    <title>flex-wrap property</title> 
    <style> 
        #main { 
            width: 400px; 
            height: 300px; 
            border: 5px solid black; 
            display: flex; 
            flex-wrap: wrap; 
        } 
          
        #main div { 
            width: 100px; 
            height: 50px; 
        } 
        h1 { 
            color:#009900; 
            font-size:42px; 
            margin-left:50px; 
        } 
        h3 { 
            margin-top:-20px; 
            margin-left:50px; 
        } 
    </style> 
</head> 
<body> 
    <h1>GeeksforGeeks</h1> 
    <h3>The flex-wrap:wrap property</h3> 
    <div id="main"> 
        <div style="background-color:#009900;">1</div> 
        <div style="background-color:#00cc99;">2</div> 
        <div style="background-color:#0066ff;">3</div> 
        <div style="background-color:#66ffff;">4</div> 
        <div style="background-color:#660066;">5</div> 
        <div style="background-color:#663300;">6</div> 
    </div> 
</body> 
</html>                    

Code Example 2

flex-wrap: nowrap|wrap|wrap-reverse|initial|inherit;

Code Example 3

<style> 
#datadiv {
  width: 200px;
  height: 200px;
  border: 1px solid #c3c3c3;
  display: flex;
  flex-wrap: wrap;
}

#datadiv div {
  width: 50px;
  height: 50px;
}
</style>
</head>
<body>

<h1>The flex-wrap Property</h1>

<div id="datadiv">
  <div style="background-color:red;">A</div>
  <div style="background-color:green;">B</div>
  <div style="background-color:yellow;">C</div>
  <div style="background-color:blue;">D</div>
  <div style="background-color:cyan;">E</div>
  <div style="background-color:indigo;">F</div>
</div>

Code Example 4

The flex-wrap property specifies whether the flexible items should wrap or not. Note: If the elements are not flexible items, the flex-wrap property has no effect.

Learn ReactJs, React Native from akashmittal.com