Hello i am new to reavt native and i don't understand how csn i get the value from Pressable/Text componente I mean I have a gender select on my app Which has Pressable and inside this a Text When the user click it should updste the state to this value that selected But i cant do it...
const SignUpPageButtons = ({ label }) => {
const [toggleColor, setToggleColor] = useState(false);
return (
<>
<Pressable
style={[{ backgroundColor: toggleColor ? "green" : "white" }, styles.button]}
onPress={() => {
setToggleColor(!toggleColor);
}}
>
<Text style={[{ color: toggleColor ? "white" : "green" }, styles.button_text]}>{label}</Text>
</Pressable>
</>
);
};