React best practices

Hisinhan / Jul 18 2021

12 mins read • 8,000 views

react practices

1.1. Create a Common Module

1.2. Use Absolute Paths

import Input from ‘@modules/common/components/Input'

1.3. Put Components in Folders

1.4. Group Components by Route/Module

1.5. Manage Dependencies Between Modules

1.6. Wrap External Components

import { Button, DatePicker } from '@modules/common/components'

1.7. How to Design a Module

1.8. Project Structure Should Tell a Story

1.9. Keep Things Close to Where They’re Used

1.10. Don’t Put Business Logic in Utility Functions


Utility functions should be small tools that you can grab and use in multiple places and occasions.

1.11. Separate Business Logic From UI