Created
April 9, 2018 15:51
-
-
Save rockymeza/437128eebdd0787816f550524da89b99 to your computer and use it in GitHub Desktop.
withTime
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
export const withTime = WrappedComponent => props => ( | |
<GetTime> | |
{({ currentTime }) => ( | |
<WrappedComponent | |
// by passing currentTime first and ...props second, we allow | |
// parent components to override the currentTime | |
currentTime={currentTime} | |
{...props} | |
/> | |
)} | |
</GetTime> | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment