@samitouri / QOS-React-2 / commits / df0d2a5106

"Don't Mutate the Original Component" example and description mismatch (#8695)

Piotr Czajkowski committed Jan 5, 2017 at 14:12 UTC df0d2a5106a225ae94ec978a99342443d57f83c2
1 file changed +1 -1
docs/docs/higher-order-components.md
+1 -1
@@ -188,7 +188,7 @@ function logProps(InputComponent) {
188 const EnhancedComponent = logProps(InputComponent);
189 ```
190
191 -There are a few problems with this. One is that the input component cannot be reused separately from the enhanced component. More crucially, if you apply another HOC to `EnhancedComponent` that *also* mutates `shouldComponentUpdate`, the first HOC's functionality will be overridden! This HOC also won't work with function components, which do not have lifecycle methods.
191 +There are a few problems with this. One is that the input component cannot be reused separately from the enhanced component. More crucially, if you apply another HOC to `EnhancedComponent` that *also* mutates `componentWillReceiveProps`, the first HOC's functionality will be overridden! This HOC also won't work with function components, which do not have lifecycle methods.
192
193 Mutating HOCs are a leaky abstraction—the consumer must know how they are implemented in order to avoid conflicts with other HOCs.
194