<RadioButtonRN
boxStyle={{
height: hp("6%"),
width: wp("80%"),
}}
activeColor="white"
boxActiveBgColor="red"
textColor="black"
textStyle={{ fontWeight: "bold" }}
data={goal}
selectedBtn={(e) => console.log(e)}
/>
<View style={{ alignItems: "center" }}>
<Text style={{ color: "red", fontSize: 15, top: hp("5%") }}>
How much would you like to gain per week?
</Text>
<RadioButtonRN
style={{ top: hp("10%") }}
boxStyle={{
height: hp("6%"),
width: wp("80%"),
}}
activeColor="white"
boxActiveBgColor="red"
textColor="black"
textStyle={{ fontWeight: "bold" }}
data={details}
selectedBtn={(e) => console.log(e)}
/>
</View>
const goal = [
{
label: "Muscle Gain",
},
{
label: "Fat Loss",
},
{
label: "Maintaining",
},
];
const details = [
{
label: "1 pound per week",
},
{
label: "0.5 pounds per week",
},
{
label: "0.25 pounds per week",
},
];
Hi, I am new to programming and I would like to know how I could change the View component depending on the selection of the Radio Button. For example, if the user selects Muscle Gain it would show View components saying "How much would you like to gain per week?" if the user selects Fat Loss it would show a View components saying "How much would you like to lose?"