Created
June 6, 2018 15:35
-
-
Save MariaSzubski/ab37948350e08740512a8fcc5fcaed3c to your computer and use it in GitHub Desktop.
React - Using an object to set multiple img properties
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
const pics = { | |
panda: "http://bit.ly/1Tqltv5", | |
owl: "http://bit.ly/1XGtkM3", | |
owlCat: "http://bit.ly/1Upbczi" | |
}; | |
const panda = ( | |
<img | |
src={pics.panda} | |
alt="Lazy Panda" /> | |
); | |
const owl = ( | |
<img | |
src={pics.owl} | |
alt="Unimpressed Owl" /> | |
); | |
const owlCat = ( | |
<img | |
src={pics.owlCat} | |
alt="Ghastly Abomination" /> | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment