Skip to content

Commit 25cc703

Browse files
authored
Updating the docs to reflect the fact that React.memo can be used wit… (#3159)
* Updating the docs to reflect the fact that React.memo can be used with both class and functional components * removed misleading para
1 parent f673d85 commit 25cc703

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

content/docs/reference-react.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,9 @@ const MyComponent = React.memo(function MyComponent(props) {
124124
});
125125
```
126126

127-
`React.memo` is a [higher order component](/docs/higher-order-components.html). It's similar to [`React.PureComponent`](#reactpurecomponent) but for function components instead of classes.
127+
`React.memo` is a [higher order component](/docs/higher-order-components.html).
128128

129-
If your function component renders the same result given the same props, you can wrap it in a call to `React.memo` for a performance boost in some cases by memoizing the result. This means that React will skip rendering the component, and reuse the last rendered result.
129+
If your component renders the same result given the same props, you can wrap it in a call to `React.memo` for a performance boost in some cases by memoizing the result. This means that React will skip rendering the component, and reuse the last rendered result.
130130

131131
`React.memo` only checks for prop changes. If your function component wrapped in `React.memo` has a [`useState`](/docs/hooks-state.html) or [`useContext`](/docs/hooks-reference.html#usecontext) Hook in its implementation, it will still rerender when state or context change.
132132

0 commit comments

Comments
 (0)