The Component Rules Will Make Your React Architecture Getting Better

When we create some React App, so confusing when we need to make a decision about when should we create a new component. Where is the folder to save our components? If you have the same thing, let’s start!

Common Components

Repeated Components

Complex UI Components

  • Product.tsx
  • ProductPicture.tsx
  • ProductDetail.tsx
  • ProductAction.tsx

Please ensure that you are creating the correct data flow and logic for that model.

If your component is small but need to be separated, you can write your codes in one file.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store