You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Major gotcha here is that the HOC in Next's case allows for implementing getInitialProps in the wrapping component. Whereas render props don't allow that.
Having said that I like render props very much, it just doesn't work in this case 😄
Context
I initially found the HOC pattern to be confusing, since (as a consumer) you can't explicitly see what prop(s) are being added.
(Also, it seems weird to create a component that can't stand on it's own, and then wrap it into something that can.)
Here is an explanation of the render-props pattern, which solves that (first) problem to offer a better Developer eXperience:
https://cdb.reacttraining.com/use-a-render-prop-50de598f11ce
The text was updated successfully, but these errors were encountered: