From b96a865a30fb5acf6b4ad6b6f5a7fc85f72ab4e2 Mon Sep 17 00:00:00 2001 From: Eric Hartline Date: Fri, 18 Jan 2019 18:44:26 -0600 Subject: [PATCH] fix(guide): correct some small typos (#30748) --- guide/english/react/higher-order-components/index.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/guide/english/react/higher-order-components/index.md b/guide/english/react/higher-order-components/index.md index 1271c1d841..9e07c604e5 100644 --- a/guide/english/react/higher-order-components/index.md +++ b/guide/english/react/higher-order-components/index.md @@ -3,7 +3,7 @@ title: Higher-Order Components --- ## Higher-Order Components -In React, a **Higher-Order Component** (HOC) is a function that takes a component and return a new component. Programmers use HOCs to achieve **component logic reuse**. +In React, a **Higher-Order Component** (HOC) is a function that takes a component and returns a new component. Programmers use HOCs to achieve **component logic reuse**. If you've used Redux's `connect`, you've already worked with Higher-Order Components. @@ -38,9 +38,9 @@ function enhance(WrappedComponent) { In this case, `enhance` returns an **anonymous class** that extends `React.Component`. This new component is doing three simple things: - * Rendering the `WrappedComponent` within a `div` element; - * Passing its own props to the `WrappedComponent`; and - * Injecting an extra prop to the `WrappedComponent`. + * Rendering the `WrappedComponent` within a `div` element + * Passing its own props to the `WrappedComponent` + * Injecting an extra prop to the `WrappedComponent` ### Caveats Higher-order components come with a few caveats that aren’t immediately obvious if you’re new to React. @@ -63,7 +63,6 @@ function enhance(WrappedComponent) { }) } ``` -HOCs are just a pattern that uses the power of React's compositional nature. **They add features to a component**. There are a lot more things you can do with them! ## Other Resources * [React docs: Higher-Order Components](https://reactjs.org/docs/higher-order-components.html)