Created
June 26, 2016 19:14
-
-
Save The-Quill/fea51710bdd50cf6b96cb15cf92393b7 to your computer and use it in GitHub Desktop.
Easy < head > element with react
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 React from 'react' | |
import Defaults from '../defaults' | |
const Head = React.createClass({ | |
render(){ | |
return <head> | |
<title>{Defaults.website_name}</title> | |
{ | |
Defaults.stylesheets.map((file, key) => <link href={file.src} key={key} />) | |
} | |
{ | |
Defaults.scripts.map((file, key) => <script src={file.src} key={key} />) | |
} | |
</head> | |
} | |
}) | |
export { Head as default } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment