ToHoc
Convert render props to higher order components.
// Takes a render prop, like <RenderButts render={({ butts }) => } />const RenderButts = <div></div> // Convert it to a higher order componentconst WithButts = // Helper component that renders all its props as a listconst ShowProps = <ul> Object </ul> const ShowButts =
Now we have ShowButts
that's wrapped in a WithButts
higher order component. This is essentially the code from react-router's WithRouter
HOC, but generalized for any component that expects a render
prop.