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:
- Planning the component and its responsibilities
- Creating the component file (.js/.jsx)
- Importing the needed dependencies (e.g. hooks, styles, other components)
- Defining the component (function/class)
- Exporting the component (export default)