Drives me nuts that there's no straightforward way to do a switch statement in JSX. {switch (page) { case 'home': return case 'about': return default: return }}
{getCorrectComponent(page)}
const getCorrectComponent = (page) => {
switch (page) {
case 'home': return
case 'about': return
default: return
}
}