Created
October 15, 2018 17:39
-
-
Save CharlyJazz/20ace88a4d1462513ac213947b6a1a2a to your computer and use it in GitHub Desktop.
WIth title with react document title
This file contains hidden or 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 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