Skip to content

Instantly share code, notes, and snippets.

@tjunghans
Created August 7, 2025 19:40
Show Gist options
  • Select an option

  • Save tjunghans/ee85a1498262f7da1f452493841b2a8a to your computer and use it in GitHub Desktop.

Select an option

Save tjunghans/ee85a1498262f7da1f452493841b2a8a to your computer and use it in GitHub Desktop.
React Typescript Filename convention
  • One exported class per file. Event better, one class per file. Uppercase *.ts file, example: MyClass.ts
  • One exported React component per file. Event better, one React component per file. Uppercase *.tsx file, example MyComponent.ts.
  • Hide complexity and simplify imports with folders and barrel files (index.ts).
  • Utilities, functions are in lowercase files.
  • Custom hooks are in "useMyCustomhook.ts" files.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment