switch return statement react typescript code example
Example: typescript react switch case component
render() {
return (
<>
{
{
foo: <Foo />,
bar: <Bar />
}[param]
}
</>
)
}
render() {
return (
<>
{
{
foo: <Foo />,
bar: <Bar />
}[param]
}
</>
)
}