Learn in Public
  • Initial page
  • NOTES
    • Data Structures
      • Use cases
    • System Design
    • Angel Investing
    • Blockchain
      • Blockchain Interoperability
      • Consensus Algorithm
      • Wallet
      • dApps
    • Brain-computer interface
    • Cognitive Science
      • Memory
      • Neuroeconomics
    • JavaScript
      • Date
      • 📚Untitled
      • Basics
      • Front-end Interview Questions
      • JS Snippets
    • Machine Learning
      • OpenAI
    • MongoDB
    • GraphQL
    • TypeScript
    • UI / UX
    • Design Systems
    • Web Development
      • React
        • File Structure
        • Hooks 🎣
        • Next.js
      • Fetch API
      • Deployment
      • Accessibility
      • DNS Settings
      • css
        • CSS Structure
      • Pretty Website
      • Design Tools
      • Snippets
    • Remote
    • Flight Pricing
    • Mental Model
    • Surveillance
    • Web optimization
    • Archive
      • Cannabis
Powered by GitBook
On this page
  • create-react-app
  • Next.js

Was this helpful?

  1. NOTES
  2. Web Development
  3. React

File Structure

PreviousReactNextHooks 🎣

Last updated 6 years ago

Was this helpful?

create-react-app

  • Group by features

    • each folder will have its own index.js, styles.css etc.

common/
  Avatar.js
  Avatar.css
  APIUtils.js
  APIUtils.test.js
feed/
  index.js
  Feed.js
  Feed.css
  FeedStory.js
  FeedStory.test.js
  FeedAPI.js
profile/
  index.js
  Profile.js
  ProfileHeader.js
  ProfileHeader.css
  ProfileAPI.js
  • Group by file type

api/
  APIUtils.js
  APIUtils.test.js
  ProfileAPI.js
  UserAPI.js
components/
  Avatar.js
  Avatar.css
  Feed.js
  Feed.css
  FeedStory.js
  FeedStory.test.js
  Profile.js
  ProfileHeader.js
  ProfileHeader.css

Next.js

components/
  Folder1/
  Folder2/
  Folder3/
  Button.js
config/
  routes.js
lib/
  utils.js
pages/
  about/
  blog/
  projects/
  index.js
static/
  styles/
    global.js (optional)
  img/
File Structure – React
Logo