Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6288

Styling only to last index of an Array in typescript React?

$
0
0

The only idea I have now is

if (customFields.values[0]) {<View style={styles.borderContainer} />; } 

For this array

let customFields: Array<{              value: any;              label: string;            }> = [];  if (query.data) {              customFields = query.data.current_squad.custom_fields                .filter(                  (customField) =>                    customField.is_visible_on_squads &&                    customField.custom_field_value.value                )                .map((customField) => {                  return {                    value: customField.custom_field_value.value,                    label: customField.title,                  };                });              }            }

But that doesn't work obviously.The end goal is to make a border at the last place in the array which is based on however many custom fields one makes.I am new to frontend and JS languages so any pointer to the right direction would be greatly appreciated.


Viewing all articles
Browse latest Browse all 6288

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>