Update higher-order-components.md (#8780)
Iurii Kucherov committed
Jan 13, 2017 at 22:17 UTC
20c4aac9ec7ebbbac593dcdde2f5e97ebfb0614d
1 file changed
+5
-3
docs/docs/higher-order-components.md
+5
-3
@@ -64,7 +64,8 @@ class CommentList extends React.Component {
64
))}
65
</div>
66
);
67
- }}
67
+ }
68
+}
69
```
70
71
Later, you write a component for subscribing to a single blog post, which follows a similar pattern:
@@ -95,7 +96,8 @@ class BlogPost extends React.Component {
96
97
render() {
98
return <BlogPost blogPost={this.state.blogPost} />;
98
- }}
99
+ }
100
+}
101
```
102
103
`CommentList` and `BlogPost` aren't identical — they call different methods on `DataSource`, and they render different output. But much of their implementation is the same:
@@ -157,7 +159,7 @@ function withSubscription(WrappedComponent, selectData) {
159
// Notice that we pass through any additional props
160
return <WrappedComponent data={this.state.data} {...this.props} />;
161
}
160
- });
162
+ };
163
}
164
```
165