i’m building React Native with Expo, trying to make custom dropdown without using liberals, i’m almost done custom dropdown but have some questions
1/i am not sure about using position: 'absolute' and how acts on different screens, also How i could make each dropdown positon on screen flow by it own input view ?
2/ how can i switch between labels so after the user press the item, the item replace and upper with (day / month / year)label ?
this is the UI i want build 
Dropdown component
const Dropdown = ({ label } ,{data} ) => {
const [days , setDays] = useState([
{num: 1 ,key: '1'},
{num: 2 , key: '2'},
{num: 3 , key: '3'},
{num: 4 , key: '4'},
{num: 5 , key: '5'},
]) ;
const [onSelect, setOnselect] = useState({ label: ''});
const DropdownButton = useRef();
const [visible , setVisible] = useState(false);
const [selected, setSelected] = useState(undefined);
const [dropdownTop, setDropdownTop] = useState(0);
const toggleFunction = () => {
visible ? setVisible(false) : openDropdown();
};
const openDropdown = ()=> {
DropdownButton.current.measure((_fx, _fy, _w, h, _px, py) => {
setDropdownTop(py + h);
});
setVisible(true);
};
const onItemPress = (item) => {
setSelecte(item);
onSelect(item);
setVisible(false);
};
const renderItem = ({ item }) => (
<TouchableOpacity style={styles.item} onPress={() => onItemPress(item)}>
<Text>{item.label}</Text>
</TouchableOpacity>
);
const renderDropdown = () =>{
return (
<Modal
visible={visible}
transparent animationType="none">
<TouchableOpacity
style={styles.overlay}
onPress={() => setVisible(false) }
>
<View style={[styles.dropdown, { top: dropdownTop }]}>
<FlatList
data={days}
showsVerticalScrollIndicator = {true}
renderItem={({item}) => (
<Text style={styles.item} > {item.num}</Text>
)}
/>
</View>
</TouchableOpacity>
</Modal >
)
}
return (
<TouchableOpacity
onPress={() => toggleFunction()}
ref={DropdownButton}
style={styles.button}>
<Text> {(onSelect.label) || label}</Text>
<MaterialCommunityIcons
name="chevron-down"
color={'#58abc8'}
size={16}
/>
{ visible == true ? ( renderDropdown ()) :null}
</TouchableOpacity>
);
}
const styles = StyleSheet.create({
button: {
flexDirection: 'row',
alignItems: 'center',
textAlign: 'center',
fontFamily: 'FrutigerLTArabicRoman',
height: 40,
width: '85%',
zIndex:1,
justifyContent: 'space-between',
marginHorizontal: 5,
},
buttonText: {
flex: 1,
textAlign: 'center',
},
dropdown: {
position: 'absolute',
left: '5%',
backgroundColor: '#fff',
width: '25%',
height:180,
shadowColor: '#000000',
shadowRadius: 4,
shadowOffset: { height: 4, width: 0 },
shadowOpacity: 0.5,
},
item: {
paddingHorizontal: 10,
paddingVertical: 4,
},
});