- Forums
- react
- React - Example Using Switch Case Break Condition In React Jsx
This Page Contains information about React - Example Using Switch Case Break Condition In React Jsx By dd in category react with 0 Replies. [5121], Last Updated: Sat Aug 24, 2024
dd
Fri May 12, 2023
0 Comments
315 Visits
This is the switch operator you can use in your react jsx code:
8-24-24 Update:
const OperatorComponents = (operator:any) =>{
switch (operator) {
// case "Addition":
// <Addition></Addition>
// break;
case "Subtraction":
<Subtraction></Subtraction>;
break;
case "Multiplication":
return (
<Multiplication
questions={questions}
setQuestions={setQuestions}
currentQuestionIndex={currentQuestionIndex}
checkInput={checkInput}
checkAnswer={checkAnswer}
itemsRef={itemsRef}
/>
);
break;
case "Division":
<Division></Division>;
break;
default:
return <Addition></Addition>
break;
}
}
return (
{operatorParam && OperatorComponents(operatorParam)}
SOURCE: /g/xampp8/htdocs/laravel/StudentTodo/ionic-rowley/ionic-rowleyV2
DOES NOT WORK
{(()=>{
switch (file.downloaded) {
case 1:
return <IonText color="medium">Downloaded</IonText>
break;
default:
break;
}
})
}