Currently I am using the ternary operator as shown below. I want to use switch-case for the same logic instead of using ternary operator. How to use it, is it possible to use switch case in return.
return(
<>
{
props.page === 1?
<h1> Hello </h1>
:" "
:
props.page === 2?
<h1> Hi </h1>
:" "
:
props.page === 3?
<h1> Good morning </h1>
:" "
</>
);
};