Put in order · JavaScript and React course · Module 1: React Basics

Process: Creating a component

Arrange the process of creating a React component:

Items to put in order

  • Importing the needed dependencies (e.g. hooks, styles, other components)
  • Creating the component file (.js/.jsx)
  • Exporting the component (export default)
  • Planning the component and its responsibilities
  • Defining the component (function/class)
Show the answer

Correct order:

  1. Planning the component and its responsibilities
  2. Creating the component file (.js/.jsx)
  3. Importing the needed dependencies (e.g. hooks, styles, other components)
  4. Defining the component (function/class)
  5. Exporting the component (export default)