Fanis Despoudis
Mar 2, 2018 · 1 min read

Hey you can go even further:

  • Separate Home into Home Container and Home Component. See this article for inspiration: Currently Home is a mixture of presentational and container components.
  • Don’t use snake case file names. Example: business_api_util
  • Use arrow functions and not binds in your constructor. Example: this.handleOnHomeLogoClick = () => this.handleHomeLogoClick()
  • Destructure state assignment. Example: const { loading, featuredBusinesses, showDefaultBackground} = this.state;
  • Prefix boolean values with is or has. Example: isLoading, hasDefaultBackground.
  • Throttle calls to fetchAndSaveFeaturedBusinesses as every click will issue a request.
  • Handle error cases as if the fetchFeaturedBusinesses() fails the component will load indefinitely.

    Fanis Despoudis

    Written by

    Senior Software Engineer @teckro, Experienced mentor @codeinstitute, @hack.hands, Technical Writer Tweet me at @nerdokto.

    Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
    Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
    Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade