Created
June 28, 2017 00:23
-
-
Save RyanCCollins/7f01fb2c593a6f1ddc91de02acc69cc5 to your computer and use it in GitHub Desktop.
Switch in IIFE
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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