You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -27,7 +27,11 @@ A common web element we might see is a user timeline. For instance, we might hav
27
27
> However, we want to make sure the timeline you build looks similar to ours. If you include the following CSS as a `<link />` tag in your code, you're timeline will look similar and will be using the same styling ours is using:
> And make sure to surround your code in a component with the class of `demo` (we left it this way purposefully as it's the _exact_ same code we use in all the demos here). Check out the [https://jsfiddle.net/auser/zwomnfwk/](https://jsfiddle.net/auser/zwomnfwk/) for a working example.
@@ -37,88 +41,96 @@ A common web element we might see is a user timeline. For instance, we might hav
37
41
> In addition, in order to make the timeline look _exactly_ like the way ours does on the site, you'll need to include [font-awesome](http://fontawesome.io/) in your web application. There are multiple ways to handle this. The simplest way is to include the link styles:
> _All_ the code for the examples on the page is available at the [github repo (at https://github.com/fullstackreact/30-days-of-react)](https://github.com/fullstackreact/30-days-of-react).
44
52
45
53
We _could_ build this entire UI in a single component. However, building an entire application in a single component is not a great idea as it can grow huge, complex, and difficult to test.
46
54
47
55
```html
48
-
class Timeline extends React.Component {
49
-
render() {
50
-
return (
51
-
<divclassName="notificationsFrame">
52
-
<divclassName="panel">
53
-
<divclassName="header">
56
+
class Timeline extends React.Component { render() { return (
<p>Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.</p>
> If we wanted to go one step further, we could even break down the title bar into 3 component parts, the _menu_ button, the _title_, and the _search_ icon. We could dive even further into each one of those if we needed to.
142
154
>
@@ -157,11 +169,9 @@ class App extends React.Component {
157
169
render() {
158
170
return (
159
171
<div className="notificationsFrame">
160
-
<div className="panel">
161
-
{/* content goes here */}
162
-
</div>
172
+
<div className="panel">{/* content goes here */}</div>
163
173
</div>
164
-
)
174
+
);
165
175
}
166
176
}
167
177
```
@@ -190,14 +200,11 @@ class Header extends React.Component {
With this knowledge, we now have the ability to write multiple components and we can start to build more complex applications.
287
290
288
291
However, you may notice that this app does not have any user interaction nor custom data. In fact, as it stands right now our React application isn't that much easier to build than straight, no-frills HTML.
289
292
290
293
In the next section, we'll look how to make our component more dynamic and become _data-driven_ with React.
0 commit comments