Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

High-order component example does not return the enhanced component #59

Closed
dennisXZX opened this issue Oct 14, 2018 · 3 comments
Closed

Comments

@dennisXZX
Copy link

In the High-order example, it seems we forget to return the enhanced component.

var enhanceComponent = (Component) => {
  class Enhance extends React.Component {
    render () {
      return (
        <Component {...this.props} />
      )
    }
  }
  
  // should we return the component here?
  return Enhance;
}
@lnfnunes
Copy link
Contributor

Actually, the example don't have the brackets after the => as you mentioned
image
So, the class is being returned correctly by the arrow function!

@dennisXZX There are any other example that I didn´t find?
If not, I think you can close this issue...

@krasimir
Copy link
Owner

@infertux good call. I was going to work on this issue today but you were first. @dennisXZX is that example that you are referring to?

@dennisXZX
Copy link
Author

@infertux thanks guys! Sorry, I am new to React I didn't know that would return the class. TIL~ Thanks again. I will close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants