Skip to content

Commit 5a6c0b5

Browse files
author
sw-yx
committed
fix typos
1 parent 3cf2a8f commit 5a6c0b5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

HOC.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ In this first section we refer closely to [the React docs on HOCs](https://react
2727
<details>
2828

2929
<summary>
30-
<b>Misc variables reference in the example below</b>
30+
<b>Misc variables referenced in the example below</b>
3131
</summary>
3232

3333
```tsx
@@ -97,6 +97,8 @@ function BlogPost({ data, id }: BlogPostProps) {
9797

9898
</details>
9999

100+
Example HOC from React Docs translated to TypeScript
101+
100102
```tsx
101103
// // ACTUAL HOC
102104
interface WithSubscriptionProps {
@@ -133,7 +135,6 @@ function withSubscription<
133135
render() {
134136
// ... and renders the wrapped component with the fresh data!
135137
// Notice that we pass through any additional props
136-
// return <WrappedComponent data={this.state.data} {...this.props} />;
137138
return <WrappedComponent data={this.state.data} {...this.props as T} />;
138139
}
139140
};

0 commit comments

Comments
 (0)