Created
April 22, 2019 13:14
-
-
Save sdesalas/fe147f6c383cd9b7804a2f5fc97c3de0 to your computer and use it in GitHub Desktop.
Simpsons avatars
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, { Component } from 'react'; | |
import logo from './logo.svg'; | |
import './App.css'; | |
import User from './User'; | |
class App extends Component { | |
render() { | |
return ( | |
<div className="App"> | |
<header className="App-header"> | |
Simpsons Avatars | |
</header> | |
<User name="Bart Simpson" avatar="https://www.stickees.com/files/cartoon/the-simpsons/2239-bart-simpson-.png"/> | |
<User name="Homer Simpson" avatar="https://upload.wikimedia.org/wikipedia/en/0/02/Homer_Simpson_2006.png"/> | |
<User name="Marge Simpson" avatar="https://static.simpsonswiki.com/images/0/0b/Marge_Simpson.png"/> | |
</div> | |
); | |
} | |
} | |
export default App; |
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
// User.js | |
import React from 'react'; | |
const User = (props) => { | |
return <div> | |
<h3>{props.name}</h3> | |
<img src={props.avatar}/> | |
</div> | |
} | |
export default User; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment