Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок0
JSX
How to write if conditions inside list options if chose this option extend the page if chose another option open new page with click button
3 ответов
+ 1
You need to learn if else statement first how its working
Suppose u create one list like
List1=[1,2,3,4,5];
And i used for loop
Which will execute from 1 to 5
for (int i=0 .....4)
Am using if condition
if( List1[2]==3)
{ Write here code what u want to do
}
Else
{ Any other task }
This is how if else working u can also do nesting
In your case in if condition write any base condition u want that if you have two button and user will click on first button then it should be expand and in else part u can write for other page .
+ 1
Bayan Here you go, select input with react example
https://code.sololearn.com/WW9rAIPLkETy/?ref=app
+ 1
Something like this ?
https://code.sololearn.com/WPJiY4iZ72gR/?ref=app