Skip to content

Instantly share code, notes, and snippets.

@fatgy
Created December 30, 2020 03:50
Show Gist options
  • Save fatgy/0f2a4406382f953d7c9ef9ca2b5750bf to your computer and use it in GitHub Desktop.
Save fatgy/0f2a4406382f953d7c9ef9ca2b5750bf to your computer and use it in GitHub Desktop.
Guidelines to improve your React folder structure
https://maxrozen.com/guidelines-improve-react-app-folder-structure/
src/
|-- components/
| |-- Avatar/
| | |-- Avatar.ts
| | |-- Avatar.test.ts
| |-- Button/
| | |-- Button.ts
| | |-- Button.test.ts
| |-- TextField/
| | |-- TextField.ts
| | |-- TextField.test.ts
|-- contexts/
| |-- UserContext/
| | |-- UserContext.ts
|-- hooks/
| |-- useMediaQuery/
| | |-- useMediaQuery.ts
|-- pages/
| |-- UserProfile/
| | |-- Components/
| | | |-- SomeUserProfileComponent/
| | | | |-- SomeUserProfileComponent.ts
| | | | |-- SomeUserProfileComponent.test.ts
| | |-- UserProfile.ts
| | |-- UserProfile.test.ts
| |-- index.ts
|-- utils/
| |-- some-common-util/
| | |-- index.ts/
| | |-- index.test.ts
|-- App.ts
|-- AuthenticatedApp.ts
|-- index.ts
|-- UnauthenticatedApp.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment