From 858d2886f93e7bb2f1c2ec7f3ffa3a9a65a819a9 Mon Sep 17 00:00:00 2001 From: Chafic Najjar Date: Mon, 26 Mar 2018 14:00:57 +0300 Subject: [PATCH] s/function components/functional components (#711) A stateless React component is referred to as a "functional component" throughout the documentation, not a "function component". --- content/docs/higher-order-components.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/docs/higher-order-components.md b/content/docs/higher-order-components.md index 4f044669..10022bb6 100644 --- a/content/docs/higher-order-components.md +++ b/content/docs/higher-order-components.md @@ -190,7 +190,7 @@ function logProps(InputComponent) { const EnhancedComponent = logProps(InputComponent); ``` -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. +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 functional components, which do not have lifecycle methods. Mutating HOCs are a leaky abstraction—the consumer must know how they are implemented in order to avoid conflicts with other HOCs.