Skip to content

Latest commit

 

History

History
13 lines (7 loc) · 689 Bytes

hoc.md

File metadata and controls

13 lines (7 loc) · 689 Bytes

Higher order components

Hoist statics

Use a package like hoist-non-react-statics to propagate statics to the higher order component.

React documentation reference: Static Methods Must Be Copied Over

Consider using render props

Render props are an alternative way to extend components. Whereas higher order components extend behavior at component definition time, render props extend behavior at render time, which can be more flexible.

See the React documentation on renderprops.