Skip to content

Instantly share code, notes, and snippets.

@RyanCCollins
Created Jun 28, 2017
Embed
What would you like to do?
Switch in IIFE
function IconPicker({ type }) {
<div>
{(() => {
switch(type) {
case 'Foo':
return <Foo />;
case 'Bar':
return <Bar />;
}
})()}
</div>
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment