Skip to content

Instantly share code, notes, and snippets.

@CharlyJazz
Created October 15, 2018 17:39
Show Gist options
  • Save CharlyJazz/20ace88a4d1462513ac213947b6a1a2a to your computer and use it in GitHub Desktop.
Save CharlyJazz/20ace88a4d1462513ac213947b6a1a2a to your computer and use it in GitHub Desktop.
WIth title with react document title
import React from 'react'
import DocumentTitle from 'react-document-title'
const withTitle = (documentTitle, WrappedComponent) => {
const hocComponent = ({ ...props }) => (
<DocumentTitle title={`${documentTitle.join(' - ')}`}>
<WrappedComponent {...props} />
</DocumentTitle>
)
return hocComponent
}
export default withTitle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment