From d1d228099d41b6dc55cad4bc65cc44cdee65dd25 Mon Sep 17 00:00:00 2001 From: Chafic Najjar Date: Mon, 26 Mar 2018 11:45:22 +0300 Subject: [PATCH] Fix grammar mistake in higher-order-components.md The word "logic" here is singular so it should be referred to with "it" instead of "them". --- 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..292cbc10 100644 --- a/content/docs/higher-order-components.md +++ b/content/docs/higher-order-components.md @@ -106,7 +106,7 @@ class BlogPost extends React.Component { - Inside the listener, call `setState` whenever the data source changes. - On unmount, remove the change listener. -You can imagine that in a large app, this same pattern of subscribing to `DataSource` and calling `setState` will occur over and over again. We want an abstraction that allows us to define this logic in a single place and share them across many components. This is where higher-order components excel. +You can imagine that in a large app, this same pattern of subscribing to `DataSource` and calling `setState` will occur over and over again. We want an abstraction that allows us to define this logic in a single place and share it across many components. This is where higher-order components excel. We can write a function that creates components, like `CommentList` and `BlogPost`, that subscribe to `DataSource`. The function will accept as one of its arguments a child component that receives the subscribed data as a prop. Let's call the function `withSubscription`: