<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Patrick Ofilada</title>
    <description>The latest articles on DEV Community by Patrick Ofilada (@pcofilada).</description>
    <link>https://dev.to/pcofilada</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F321065%2F2061369d-e5bb-4885-8c65-78ca2875a1f7.png</url>
      <title>DEV Community: Patrick Ofilada</title>
      <link>https://dev.to/pcofilada</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/pcofilada"/>
    <language>en</language>
    <item>
      <title>Simple React Folder Structure</title>
      <dc:creator>Patrick Ofilada</dc:creator>
      <pubDate>Tue, 25 Aug 2020 02:54:14 +0000</pubDate>
      <link>https://dev.to/pcofilada/simple-react-folder-structure-31lj</link>
      <guid>https://dev.to/pcofilada/simple-react-folder-structure-31lj</guid>
      <description>&lt;p&gt;So you manage to finish all of those tutorial and you already run those generate commands, so what's next? Most of the time after generating new react project developers don't know where to put or organize their codes.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--TJAXHVZU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/jivw790nf88oen304aup.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TJAXHVZU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/jivw790nf88oen304aup.jpg" alt="Developer"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After doing some research, trial and error on different react projects, I found the folder structure that works best for me and for my team.&lt;/p&gt;

&lt;p&gt;This article is opinionated and you are welcome to adjust it for your own use case. Here's how I organize my React applications:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.
├── README.md
├── package.json
├── tsconfig.json
├── public/
└── src/
    ├── index.tsx
    ├── routes.ts
    ├── api/
    ├── assets/
    ├── config/
    ├── containers/
    ├── context/
    ├── types/
    ├── utils/
    └── components/
        └── common/
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h4&gt;
  
  
  Here's a quick overview for each item or folder.
&lt;/h4&gt;

&lt;p&gt;&lt;code&gt;src/&lt;/code&gt; - Contains all of our react codebase.&lt;br&gt;
&lt;code&gt;index.tsx&lt;/code&gt; - Base react component. If you are not using typescript just change this to &lt;em&gt;'index.js'&lt;/em&gt; or &lt;em&gt;'index.jsx'&lt;/em&gt;.&lt;br&gt;
&lt;code&gt;routes.ts&lt;/code&gt; - App navigation. If you are not using typescript just change this to &lt;em&gt;'routes.js'&lt;/em&gt;.&lt;br&gt;
&lt;code&gt;api/&lt;/code&gt; - Api call related functions.&lt;br&gt;
&lt;code&gt;assets/&lt;/code&gt; - Images, fonts and other static files.&lt;br&gt;
&lt;code&gt;config/&lt;/code&gt; - Config files&lt;br&gt;
&lt;code&gt;containers/&lt;/code&gt; - &lt;a href="https://medium.com/@thejasonfile/dumb-components-and-smart-components-e7b33a698d43"&gt;Smart Components&lt;/a&gt;&lt;br&gt;
&lt;code&gt;context/&lt;/code&gt; - &lt;a href="https://reactjs.org/docs/context.html"&gt;React context&lt;/a&gt;&lt;br&gt;
&lt;code&gt;types/&lt;/code&gt; - Typescript related files or functions.&lt;br&gt;
&lt;code&gt;utils/&lt;/code&gt; - Helper functions&lt;br&gt;
&lt;code&gt;components/&lt;/code&gt; - &lt;a href="https://medium.com/@thejasonfile/dumb-components-and-smart-components-e7b33a698d43"&gt;Dumb Components&lt;/a&gt;&lt;br&gt;
&lt;code&gt;components/common/&lt;/code&gt; - Shared components&lt;/p&gt;

&lt;p&gt;You can check this folder structure &lt;a href="https://github.com/pcofilada/simple-react-starter"&gt;here&lt;/a&gt;.&lt;br&gt;
If you are also using redux on your react application you can check how does it looks &lt;a href="https://github.com/pcofilada/simple-react-starter/tree/redux"&gt;here&lt;/a&gt;.&lt;br&gt;
I have implemented it with React Native application also, check it &lt;a href="https://github.com/pcofilada/simple-react-native-starter"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Wrap Up
&lt;/h2&gt;

&lt;p&gt;If you have any questions or recommendations, please leave them in the comments below.&lt;/p&gt;

&lt;p&gt;Thanks for reading.&lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>typescript</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
