Created
February 24, 2020 23:25
-
-
Save manakuro/5633c09edc4c0d9378536fd3cdfd3ea9 to your computer and use it in GitHub Desktop.
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
const getColoredComponent = color => { | |
if(color === 'blue') { return <BlueComponent/>; } | |
if(color === 'red') { return <RedComponent/>; } | |
if(color === 'green') { return <GreenComponent/>; } | |
} | |
const Component = props => | |
<div className='myComponent'> | |
{getColoredComponent()} | |
</div> | |
; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment