File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ In this first section we refer closely to [the React docs on HOCs](https://react
27
27
<details >
28
28
29
29
<summary >
30
- <b >Misc variables reference in the example below</b >
30
+ <b >Misc variables referenced in the example below</b >
31
31
</summary >
32
32
33
33
``` tsx
@@ -97,6 +97,8 @@ function BlogPost({ data, id }: BlogPostProps) {
97
97
98
98
</details >
99
99
100
+ Example HOC from React Docs translated to TypeScript
101
+
100
102
``` tsx
101
103
// // ACTUAL HOC
102
104
interface WithSubscriptionProps {
@@ -133,7 +135,6 @@ function withSubscription<
133
135
render() {
134
136
// ... and renders the wrapped component with the fresh data!
135
137
// Notice that we pass through any additional props
136
- // return <WrappedComponent data={this.state.data} {...this.props} />;
137
138
return <WrappedComponent data = { this .state .data } { ... this .props as T } />;
138
139
}
139
140
};
You can’t perform that action at this time.
0 commit comments