LoginSignup
2
1

More than 3 years have passed since last update.

僕が考えた最強の React ファイル構成

Last updated at Posted at 2020-06-26

技術スタック

僕が考えた最強の React 技術スタック

Grouping by file type

基本的にこの考え方でフォルダを分ける

命名規則

キャメルケース

ファイル構成

  • app.yaml
  • app.storybook.yaml
  • cloudbuild.yaml
  • firebase.json
  • json-server # 検討中
  • public / static
    • favicon.ico
  • src
    • App.tsx
    • index.tsx
    • api / services
      • fooApi.ts / fooService.ts
    • components
      • Foo.tsx
    • constants
    • containers
      • Foo.tsx
    • contexts
    • firebase
    • functions
    • layouts # たぶん必要ない
    • models / types
    • pages
      • index.tsx
    • store
      • store.ts
      • actions
        • foo.ts
      • facades
      • reducers
        • foo.ts
      • selectors
        • foo.ts
      • states
        • foo.ts
    • stories
      • foo.stories.ts
    • test # 検討中
      • pages
        • __snapshots__
        • index.test.tsx / index.spec.tsx

※ 自動生成されるファイルについてはいくつか省略してます

参考

2
1
4

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1