title: How to select an item from list and store it on the state React Native
body: <p>Im having hard time to resolve this logic, I hope somebody can help. When the address 2 is pressed I want to get that value and replace the Address 1 with it. How can I select the item and store it on the state or replace the Address 1 with it??? Below is my code:</p>
  <pre><code> const [collapse, setCollapse] = useState(false);
  </code></pre>
  <pre><code> &lt;Collapse
            style={styles.locationContainer}
            isCollapsed={collapse}
            onToggle={(isCollapsed) =&gt; setCollapse(isCollapsed)}
          &gt;
            &lt;CollapseHeader&gt;
              &lt;View onPress={() =&gt; setCollapse(!collapse)}&gt;
                &lt;Text style={styles.title}&gt;Choose location&lt;/Text&gt;
                &lt;View style={styles.friendsContainer}&gt;
                  &lt;View style={styles.itemsContainerLocation}&gt;
                    &lt;Text style={styles.subTitle}&gt;Address 1&lt;/Text&gt;
                    &lt;Text style={styles.default}&gt;(default)&lt;/Text&gt;
                  &lt;/View&gt;
                  {collapse ? (
                    &lt;Ionicons name=&quot;ios-arrow-up&quot; size={24} color=&quot;black&quot; /&gt;
                  ) : (
                    &lt;Ionicons name=&quot;ios-arrow-down&quot; size={20} color=&quot;black&quot; /&gt;
                  )}
                &lt;/View&gt;
              &lt;/View&gt;
            &lt;/CollapseHeader&gt;
            &lt;CollapseBody&gt;
              &lt;View style={styles.adressesContainer}&gt;
                &lt;TouchableOpacity&gt;
                  &lt;Text style={styles.adressesName}&gt;Address 2&lt;/Text&gt;
                &lt;/TouchableOpacity&gt;
              &lt;/View&gt;
              &lt;View style={styles.adressesContainer}&gt;
                &lt;TouchableOpacity&gt;
                  &lt;Text style={styles.adressesName}&gt;Address 3&lt;/Text&gt;
                &lt;/TouchableOpacity&gt;
              &lt;/View&gt;
              &lt;View style={styles.adressesContainer}&gt;
                &lt;TouchableOpacity&gt;
                  &lt;Text style={styles.adressesName}&gt;Address 4&lt;/Text&gt;
                &lt;/TouchableOpacity&gt;
              &lt;/View&gt;
            &lt;/CollapseBody&gt;
          &lt;/Collapse&gt;
  </code></pre>