-
Notifications
You must be signed in to change notification settings - Fork 0
/
ApplyComponents.js
41 lines (32 loc) · 919 Bytes
/
ApplyComponents.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Cuando un componente representa otro componente, lo que sucede es muy similar
// a lo que sucede cuando ReactDOM.render()representa un componente.
// ProfilePage
import React from 'react';
import ReactDOM from 'react-dom';
class ProfilePage extends React.Component {
render() {
return (
<div>
<NavBar />
<h1>All About Me!</h1>
<p>I like movies and blah blah blah blah blah</p>
<img src="https://s3.amazonaws.com/codecademy-content/courses/React/react_photo-monkeyselfie.jpg" />
</div>
);
}
}
// Example NavBar
import React from 'react';
class NavBar extends React.Component {
render() {
const pages = ['home', 'blog', 'pics', 'bio', 'art', 'shop', 'about', 'contact'];
const navLinks = pages.map(page => {
return (
<a href={'/' + page}>
{page}
</a>
)
});
return <nav>{navLinks}</nav>;
}
}