Created
April 22, 2017 04:10
-
-
Save abiodun0/566cb11be4490464ea3b40c0614e9982 to your computer and use it in GitHub Desktop.
Nifty Component Conditionals
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 when = (val, whenTrue) => { if (val) { return whenTrue() } else { return null } } | |
{when(thingIsTrue, () => <Component />)} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment