Skip to content

Commit 13f4d55

Browse files
authored
Update higher-order-components.md
1 parent 8ac52a6 commit 13f4d55

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

content/docs/higher-order-components.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ import MyComponent, { someFunction } from './MyComponent.js';
394394

395395
### Refs Aren't Passed Through
396396

397-
While the convention for higher-order components is to pass through all props to the wrapped component, it's not possible to pass through refs. That's because `ref` is not really a prop — like `key`, it's handled specially by React. If you add a ref to an element whose component is the result of a HOC, the ref refers to an instance of the outermost container component, not the wrapped component.
397+
While the convention for higher-order components is to pass through all props to the wrapped component, it's not possible to pass through refs. That's because `ref` is not really a prop — like `key`, it's handled especially by React. If you add a ref to an element whose component is the result of a HOC, the ref refers to an instance of the outermost container component, not the wrapped component.
398398

399399
If you find yourself facing this problem, the ideal solution is to figure out how to avoid using `ref` at all. Occasionally, users who are new to the React paradigm rely on refs in situations where a prop would work better.
400400

0 commit comments

Comments
 (0)