Created
February 6, 2019 08:16
-
-
Save steelydylan/1be5a0878d646488c2c01565eec7b91b to your computer and use it in GitHub Desktop.
ConditionalWrapComponent
This file contains 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
import * as React from 'react'; | |
interface ConditionalWrapType{ | |
condition: boolean, | |
wrap: (children) => React.ReactNode | |
children: React.ReactNode | |
} | |
export default ({condition, wrap, children}): React.SFCElement<ConditionalWrapType> => condition ? wrap(children) : children; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment