User Avatar

Senior Software Engineer | I help web developers to learn Next.js | 10+ years industry experience

8 Step Framework For Creating Production Ready React Components

This is my framework for creating a React form component that talks (GET & POST) with an API:

  1. Create the HTML for the form. No functionality yet, just the structure.

  2. Add the data fetching from the api. No error handling yet, just getting the data to the component and console.logging it.

  3. Add state for the form and populate the form with the data

  4. Add functionality for a save button. Getting the data from the state and sending it to the api. No error handling or loading indicators yet.

  5. Add loading indicators and disable fields when saving and fetching the data

  6. Add notification for successful saving

  7. Add error handling and show notification for errors

  8. Add css styling

This is more or less the framework I use when creating components from scratch.


The most important thing here is that you split the tasks in smaller chunks and don't try to make everything at once.