Higher Order Components: Theory and Practice

Higher order #ReactJS components: Theory and practice

  • Instead of loading the same data in each component, we might use higher-order component.
  • this.props} /> : null }

); } } const mapStateToProps = (state) => { return { user: state.account.user }; }; return connect(mapStateToProps)(AuthenticatedComponent); }

  • this.props} /> : null }