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