Last active
January 28, 2020 20:48
-
-
Save CaptainN/471a3d00d2ff86359429437472109d19 to your computer and use it in GitHub Desktop.
Meteor Containers from Hooks
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 { useTracker } from 'meteor/react-meteor-data' | |
// We can easily make old style HOCs out of the hooks | |
const withUser = (Component) => (props) => { | |
const accountProps = useAccount() | |
return <Component {...props} {...accountProps} /> | |
} | |
const withPage = (Component) => (props) => ( | |
const pageProps = usePage(props.pageId) | |
return <Component {...props} {...pageProps} /> | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment