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
Copy file name to clipboardExpand all lines: HOC.md
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@
22
22
23
23
In this first section we refer closely to [the React docs on HOCs](https://reactjs.org/docs/higher-order-components.html) and offer direct TypeScript parallels.
24
24
25
-
## Docs Example: Use HOCs For Cross-Cutting Concerns
25
+
## Docs Example: [Use HOCs For Cross-Cutting Concerns](https://reactjs.org/docs/higher-order-components.html#use-hocs-for-cross-cutting-concerns)
## Docs Example: Don’t Mutate the Original Component. Use Composition.
167
+
## Docs Example: [Don’t Mutate the Original Component. Use Composition.](https://reactjs.org/docs/higher-order-components.html#dont-mutate-the-original-component-use-composition)
168
168
169
169
This is pretty straightforward - make sure to assert the passed props as `T`[due to the TS 3.2 bug](https://github.com/Microsoft/TypeScript/issues/28938#issuecomment-450636046).
170
170
@@ -185,11 +185,11 @@ function logProps<T>(WrappedComponent: React.ComponentType<T>) {
185
185
}
186
186
```
187
187
188
-
## Docs Example: Pass Unrelated Props Through to the Wrapped Component
188
+
## Docs Example: [Pass Unrelated Props Through to the Wrapped Component](https://reactjs.org/docs/higher-order-components.html#convention-pass-unrelated-props-through-to-the-wrapped-component)
HOCs can take the form of Functions that return Higher Order Components that return Components.
195
195
@@ -277,7 +277,7 @@ function connect(mapStateToProps: Function, mapDispatchToProps: Function) {
277
277
}
278
278
```
279
279
280
-
## Docs Example: Wrap the Display Name for Easy Debugging
280
+
## Docs Example: [Wrap the Display Name for Easy Debugging](https://reactjs.org/docs/higher-order-components.html#convention-wrap-the-display-name-for-easy-debugging)
281
281
282
282
This is pretty straightforward as well.
283
283
@@ -303,7 +303,7 @@ function getDisplayName<T>(WrappedComponent: React.ComponentType<T>) {
0 commit comments