Created
August 1, 2018 19:42
-
-
Save danbruegge/514cf73337ce97a91bdbed6aa9ba93a4 to your computer and use it in GitHub Desktop.
PreloadImages.jsx
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 PropTypes from 'prop-types'; | |
const PreloadImages = ({ urls }) => urls.map(url => ( | |
<span key={url} style={{ backgroundImage: `url(${url})` }} /> | |
)); | |
PreloadImages.propTypes = { | |
urls: PropTypes.arrayOf(PropTypes.string).isRequired, | |
}; | |
export default PreloadImages; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment