Question · JavaScript and React course · Module 8: Advanced React Patterns

Introduction: HOC Naming Convention

What is the standard naming convention for Higher-Order Components?

Answer options

  • Prefix 'with' - e.g. withAuth, withTheme, withRouter
  • Prefix 'use' - e.g. useAuth, useTheme, useRouter
  • Suffix 'HOC' - e.g. AuthHOC, ThemeHOC, RouterHOC
  • Prefix 'create' - e.g. createAuth, createTheme, createRouter

You can check the correct answer by solving this task in the CodeWorlds game.