Skip to content

Instantly share code, notes, and snippets.

@CaptainN
Last active January 28, 2020 20:48
Show Gist options
  • Save CaptainN/471a3d00d2ff86359429437472109d19 to your computer and use it in GitHub Desktop.
Save CaptainN/471a3d00d2ff86359429437472109d19 to your computer and use it in GitHub Desktop.
Meteor Containers from Hooks
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