Publish to my blog (weekly)
Higher-Order Components - React Concretely, a higher-order component is a function that takes a component and returns a new component. Whereas a component transforms props into UI, a higher-order component transforms a component into another component. HOCs are common in third-party React libraries, such as Redux's connect and Relay's createContainer . // This function takes a component... function withSubscription ( WrappedComponent , selectData ) { // ...and returns another component... return class extends React . Component { constructor ( props ) { super ( props ); this . handleChange = this . hand...