<?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: Manoj M S</title>
    <description>The latest articles on DEV Community by Manoj M S (@manojms).</description>
    <link>https://dev.to/manojms</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%2F423983%2F033f1496-4b5b-4661-9a81-5d77d1c27a02.png</url>
      <title>DEV Community: Manoj M S</title>
      <link>https://dev.to/manojms</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/manojms"/>
    <language>en</language>
    <item>
      <title>DIECAST CARS FOR COLLECTORS: YOUR GATEWAY TO AUTOMOTIVE MINIATURE MASTERY</title>
      <dc:creator>Manoj M S</dc:creator>
      <pubDate>Mon, 04 Aug 2025 15:48:45 +0000</pubDate>
      <link>https://dev.to/manojms/diecast-cars-for-collectors-your-gateway-to-automotive-miniature-mastery-4p4j</link>
      <guid>https://dev.to/manojms/diecast-cars-for-collectors-your-gateway-to-automotive-miniature-mastery-4p4j</guid>
      <description>&lt;p&gt;You know that feeling when you spot a perfect 1:18 Ferrari in a shop window? That little rush of "I need that in my life"? Yeah, that's how most of us got hooked on diecast cars for collectors. What starts as "just one cool model" quickly becomes a full-blown passion that's equal parts art appreciation, history lesson, and treasure hunt.&lt;/p&gt;

&lt;p&gt;The diecast collecting world isn't just growing – it's exploding. We're talking about a &lt;a href="https://www.archivemarketresearch.com/reports/diecast-cars-531346" rel="noopener noreferrer"&gt;global market worth \$4.9 billion in 2023&lt;/a&gt;, projected to hit \$7 billion by 2030. Those aren't just numbers; they're proof that serious collectors worldwide are recognizing what we've known all along – these aren't toys, they're miniature masterpieces.&lt;/p&gt;

&lt;p&gt;Whether you're eyeing your first model or looking to refine a collection that's taken over your spare room, this guide breaks down everything you need to know about building a collection that's both personally satisfying and potentially profitable.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why Diecast Cars Hit Different Than Other Collectibles
&lt;/h2&gt;

&lt;p&gt;Let's be real – you could collect stamps, coins, or vintage postcards. But &lt;a href="https://www.hearnshobbies.com/blogs/die-cast/understanding-the-psychology-behind-diecast-model-collecting" rel="noopener noreferrer"&gt;diecast model cars offer something unique&lt;/a&gt;: they're tangible pieces of automotive history that connect us to the machines we dream about owning.&lt;/p&gt;

&lt;p&gt;The manufacturing process itself is fascinating. &lt;a href="https://www.diecasting-mould.com/news/diecast-car-scale-size-guide-dimensions-prices-best-scale-ranking" rel="noopener noreferrer"&gt;Die-casting involves forcing molten metal under high pressure&lt;/a&gt; into precision molds, creating incredibly detailed replicas that capture everything from accurate body lines to functional elements like opening doors and detailed interiors.&lt;/p&gt;

&lt;p&gt;What makes collecting these miniatures addictive goes beyond just the craftsmanship. There's the nostalgia factor – that '67 Mustang your dad always talked about, or the Lamborghini poster that covered your teenage bedroom wall. There's the investment potential (more on that later), and honestly, there's something deeply satisfying about curating a collection that tells a story.&lt;/p&gt;




&lt;h2&gt;
  
  
  Choosing Your Scale: Size Actually Matters
&lt;/h2&gt;

&lt;p&gt;Here’s where many new collectors make their first big decision. Scale isn't just about how much shelf space you have; it's about what you want from your collection.&lt;/p&gt;

&lt;h3&gt;
  
  
  1:64 Scale – The Gateway Drug
&lt;/h3&gt;

&lt;p&gt;At roughly 2.5 inches long, &lt;a href="https://diecastparkingapp.com/blog/understanding-model-car-scales-a-comprehensive-guide-for-all" rel="noopener noreferrer"&gt;1:64 scale models are the most accessible entry point&lt;/a&gt;. You know these – Hot Wheels, Matchbox, the models that started most of our obsessions.&lt;/p&gt;

&lt;p&gt;They're budget-friendly, space-efficient, and come in endless variety. Perfect for testing the waters or &lt;a href="https://www.carandbike.com/news/beginners-guide-to-collecting-diecast-models-2699271" rel="noopener noreferrer"&gt;building themed collections&lt;/a&gt; without breaking the bank.&lt;/p&gt;

&lt;h3&gt;
  
  
  1:43 Scale – The Sweet Spot
&lt;/h3&gt;

&lt;p&gt;At 3.5-5 inches, this scale is the traditional collector’s favorite. You get significantly more detail than 1:64 while keeping space usage reasonable.&lt;/p&gt;

&lt;p&gt;Expect to pay \$10-80, with premium pieces higher.&lt;/p&gt;

&lt;h3&gt;
  
  
  1:24 Scale – American Muscle
&lt;/h3&gt;

&lt;p&gt;Measuring 6-8 inches, &lt;a href="https://www.awesomediecast.com/choosing-right-scale/" rel="noopener noreferrer"&gt;this scale strikes a balance between detail and affordability&lt;/a&gt;. Typical prices range from \$20-150.&lt;/p&gt;

&lt;h3&gt;
  
  
  1:18 Scale – The Showstoppers
&lt;/h3&gt;

&lt;p&gt;At 9-12 inches, &lt;a href="https://www.autobarnmodel.com/understanding-the-various-scales-of-collectible-diecast-model-cars/" rel="noopener noreferrer"&gt;these are primarily targeted at adult collectors&lt;/a&gt;. Opening doors, detailed interiors, and \$30-300 price tags make these models the centerpiece of any collection.&lt;/p&gt;

&lt;h3&gt;
  
  
  1:12 Scale – The Holy Grail
&lt;/h3&gt;

&lt;p&gt;At 14-15 inches and \$300-700+, these are reserved for iconic vehicles or ultra-detailed masterpieces.&lt;/p&gt;




&lt;h2&gt;
  
  
  Building Your Collection Strategy (Not Just Buying Random Cool Stuff)
&lt;/h2&gt;

&lt;p&gt;Random purchases lead to cluttered collections. &lt;a href="https://holdenlegends.com.au/blogs/news/how-to-start-your-diecast-car-collection-tips-for-beginners" rel="noopener noreferrer"&gt;Successful collecting requires establishing a clear focus&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Brand-Focused
&lt;/h3&gt;

&lt;p&gt;Collect Ferraris, Porsches, or BMWs and become an expert in that marque’s history.&lt;/p&gt;

&lt;h3&gt;
  
  
  Era-Based
&lt;/h3&gt;

&lt;p&gt;Focus on muscle cars from the ‘60s or hypercars from the 2000s to build a historical narrative.&lt;/p&gt;

&lt;h3&gt;
  
  
  Racing Heritage
&lt;/h3&gt;

&lt;p&gt;F1, NASCAR, WRC – race cars plus their road versions make a dynamic combo.&lt;/p&gt;

&lt;h3&gt;
  
  
  Pop Culture
&lt;/h3&gt;

&lt;p&gt;Think &lt;em&gt;Back to the Future&lt;/em&gt;’s DeLorean or Bond’s Aston Martin. Limited availability and higher prices due to licensing.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Investment Game: When Passion Meets Profit
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://diecastmodelcentre.co.uk/blogs/news/collectable-models-an-investment-or-just-a-hobby" rel="noopener noreferrer"&gt;The diecast collecting market has shown consistent growth&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  What Makes Models Valuable
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Rarity &amp;amp; Limited Editions&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Condition &amp;amp; Packaging&lt;/strong&gt;: &lt;a href="https://diecastparkingapp.com/blog/are-diecast-model-cars-a-good-investment-what-you-need-to-know" rel="noopener noreferrer"&gt;Original boxes can increase value by 20% or more&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Brand Reputation&lt;/strong&gt;: AUTOart, Kyosho, Minichamps&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Real-World ROI Examples
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Model&lt;/th&gt;
&lt;th&gt;Original Price&lt;/th&gt;
&lt;th&gt;Current Value&lt;/th&gt;
&lt;th&gt;ROI&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Hot Wheels Japan Historics Set&lt;/td&gt;
&lt;td&gt;\$40&lt;/td&gt;
&lt;td&gt;\$600+&lt;/td&gt;
&lt;td&gt;1,400%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Rare Vintage Hot Wheels&lt;/td&gt;
&lt;td&gt;\$1-2&lt;/td&gt;
&lt;td&gt;\$10,000+&lt;/td&gt;
&lt;td&gt;500,000%+&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Limited AUTOart 1:18&lt;/td&gt;
&lt;td&gt;\$150&lt;/td&gt;
&lt;td&gt;\$400+&lt;/td&gt;
&lt;td&gt;167%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  Storage and Display: Protecting Your Investment
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://snooplay.in/blogs/news/preserving-your-diecast-cars-maintenance-tips-for-long-term-value" rel="noopener noreferrer"&gt;Proper storage and display are crucial&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Display Options
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Glass Cases&lt;/strong&gt;: Premium protection from dust/UV.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Acrylic Cases&lt;/strong&gt;: &lt;a href="https://www.tinytown.in/blogs/news/how-to-display-diecast-cars" rel="noopener noreferrer"&gt;Affordable, lightweight&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Wall Shelves&lt;/strong&gt;: Great for big collections, but expose to dust.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Storage Options
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Storage Cabinets&lt;/strong&gt;: Max protection but limited visibility. Use &lt;a href="https://diecastparkingapp.com/blog/ways-to-store-your-diecast-model-collection-safely-and-effectively" rel="noopener noreferrer"&gt;cataloging systems&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Specialized Diecast Storage&lt;/strong&gt;: Tailored compartments, high protection.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Cataloging: Because "I Think I Have That One" Isn’t a System
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://livecarmodel.com/blog/5-tips-for-cataloging-your-diecast-model-collection/" rel="noopener noreferrer"&gt;Proper cataloging becomes essential&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Digital Tools
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Apps&lt;/strong&gt;: Diecast Parking App – includes barcode scanning, price tracking.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Spreadsheets&lt;/strong&gt;: Google Sheets with model details + photos.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Organization Styles
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;By Manufacturer&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;By Scale&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Maintenance: Keeping Your Collection Looking Fresh
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.carandbike.com/news/how-to-care-for-your-diecast-collection-to-keep-it-looking-new-2951690" rel="noopener noreferrer"&gt;Proper maintenance preserves both aesthetic and value&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Cleaning
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Dusting&lt;/strong&gt;: Microfiber cloth + soft brushes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Deep Cleaning&lt;/strong&gt;: Mild soap + damp cloth. Avoid chemicals.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Environment
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;UV Protection&lt;/strong&gt;: Avoid direct sunlight.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Climate Control&lt;/strong&gt;: Keep consistent temperature/humidity.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Common Mistakes That’ll Cost You
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Don’t Do This
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Lack of Focus&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Buying Low-Quality Models&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Improper Storage&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Impulse Buying Without Research&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Building Community: It’s Not Just About the Cars
&lt;/h2&gt;

&lt;p&gt;The community enhances the collecting experience.&lt;/p&gt;

&lt;h3&gt;
  
  
  Online
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Forums like &lt;a href="https://diecast.org/community/" rel="noopener noreferrer"&gt;DiecastCrazy.com &amp;amp; Diecast Zone Forums&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;YouTube, Instagram, and Facebook groups&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Offline
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Collector clubs&lt;/li&gt;
&lt;li&gt;Trade shows and toy fairs&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  The Future of Diecast Collecting
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Trends to Watch
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.marketresearchintellect.com/blog/diecast-model-cars-shift-into-high-gear-amid-rising-collector-interest" rel="noopener noreferrer"&gt;Electric Vehicle Models&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Tech integrations: LED lights, sounds, remote control&lt;/li&gt;
&lt;li&gt;AR/NFT/digital crossover collectibles&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Your Collection Journey Starts Now
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://kollectibles.in/" rel="noopener noreferrer"&gt;Diecast cars for collectors&lt;/a&gt; offer a hobby that combines passion, history, and investment. Start with a clear focus, invest in quality, document everything, and engage with the community.&lt;/p&gt;

&lt;p&gt;Collect what excites you – whether it’s a \$5 Hot Wheels or a \$500 AUTOart masterpiece. That joy of discovering a new piece? That never gets old.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ready to start or level up your collection? The road ahead is full of discoveries. Happy collecting!&lt;/strong&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Basic Git Commands</title>
      <dc:creator>Manoj M S</dc:creator>
      <pubDate>Sun, 05 Jul 2020 13:14:26 +0000</pubDate>
      <link>https://dev.to/manojms/basic-git-commands-jkp</link>
      <guid>https://dev.to/manojms/basic-git-commands-jkp</guid>
      <description>&lt;h2&gt;
  
  
  Step By Step Guide to make your first Repository:
&lt;/h2&gt;

&lt;h2&gt;
  
  
  Step 1:
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Make a Folder:
&lt;/h3&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt; \Desktop&amp;gt; mkdir First-repo
 \Desktop&amp;gt; cd First-repo
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2&gt;
  
  
  Step 2:
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Initialize The Repository:
&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt; \Desktop\First-repo&amp;gt; git init
  Initialized empty Git repository in 
  C:/Users/LALITHA/Desktop/First-repo/.git/
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2&gt;
  
  
  Step 3:
&lt;/h2&gt;
&lt;h4&gt;
  
  
  Create New File index.html inside First-repo folder.
&lt;/h4&gt;
&lt;h2&gt;
  
  
  Step 4:
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Check Status :
&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  \Desktop\First-repo&amp;gt; git status
   On branch master

   No commits yet

   Untracked files:
   (use "git add &amp;lt;file&amp;gt;..." to include in what will be 
    committed)
    index.html

   nothing added to commit but untracked files present (use 
   "git add" to track)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2&gt;
  
  
  Step 5:
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Add Your Changes:
&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  \Desktop\First-repo&amp;gt; git add .
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2&gt;
  
  
  Step 6:
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Commit Your Changes:
&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt; \Desktop\First-repo&amp;gt; git commit -m"Message"
 [master (root-commit) 0b98ccc] Message
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 index.html
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2&gt;
  
  
  Step 7:
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Push Your Changes:
&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt; \Desktop\gitexample\First-repo&amp;gt; git remote add origin 
  https://github.com/Manoj-M-S/First-repo.git
 \Desktop\gitexample\First-repo&amp;gt; git push -u origin master
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Thank you for reading!&lt;/p&gt;

</description>
      <category>git</category>
    </item>
    <item>
      <title>How to Fix useEffect Hook executing in an endless loop?</title>
      <dc:creator>Manoj M S</dc:creator>
      <pubDate>Sun, 05 Jul 2020 12:40:33 +0000</pubDate>
      <link>https://dev.to/manojms/how-to-fix-useeffect-hook-executing-in-an-endless-loop-1oga</link>
      <guid>https://dev.to/manojms/how-to-fix-useeffect-hook-executing-in-an-endless-loop-1oga</guid>
      <description>&lt;h2&gt;
  
  
  First of all let us see what useEffect Hook does?
&lt;/h2&gt;

&lt;p&gt;Using useEffect Hook, tells React that your component needs to do something after render. React will remember the function you passed and call it later after performing the DOM updates.&lt;/p&gt;

&lt;h2&gt;
  
  
  Does useEffect run after every render?
&lt;/h2&gt;

&lt;p&gt;Yes! By default, it runs both after the first render and after every update. Unlike componentDidMount, useEffect is not executed when the component finished mounting, but each time the component is rendered.&lt;br&gt;
That means if you modify the components state inside useEffect, it will cause a re-render of the component, which again causes the execution of useEffect.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;useEffect(() =&amp;gt; {
//This is executed each time the component is rendered.
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;That’s why useEffect takes an array of dependencies as a second argument. If we don’t pass an array of dependencies, the Hook will be executed in a loop.&lt;/p&gt;

&lt;p&gt;You can tell React to skip applying an effect if certain values haven’t changed between re-renders, By passing an array as an optional second argument to useEffect each time one of those objects change, React will execute this Hook. You could pass in any number of values into the array and useEffect will only run when any one of the values change.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;useEffect(() =&amp;gt; {
Document.title = `You clicked ${count} times`;
},[count]); // Only re-run the effect if count changes
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;But what if we only want the hook to execute when the component is mounted and rendered the first time?&lt;br&gt;
We already know, if we don’t pass an array of dependencies, the Hook will be executed in a loop. But what if our hook does not depend on any other object?&lt;/p&gt;

&lt;h3&gt;
  
  
  So we pass an empty array.
&lt;/h3&gt;

&lt;p&gt;By passing in an empty array, we're telling React not to track any changes, only run once, effectively simulating componentDidMount.&lt;/p&gt;

&lt;p&gt;That’s it:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;useEffect(() =&amp;gt; {
  // this is only executed once
}, [])
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;If we pass an empty array to useEffect, it’s only executed after the first render.&lt;/p&gt;

&lt;p&gt;This is even mentioned in &lt;a href="https://reactjs.org/docs/hooks-effect.html#tip-optimizing-performance-by-skipping-effects"&gt;the official React Hooks API documentation&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If you want to run an effect and clean it up only once (on mount and unmount), you can pass an empty &amp;gt;array ([]) as a second argument. This tells React that your effect doesn’t depend on any values from &amp;gt;props or state, so it never needs to re-run. This isn’t handled as a special case — it follows &amp;gt;directly from how the dependencies array always works.&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>react</category>
    </item>
    <item>
      <title>Create a basic React Project by implementing React-Router within 10 mins</title>
      <dc:creator>Manoj M S</dc:creator>
      <pubDate>Sun, 05 Jul 2020 12:38:14 +0000</pubDate>
      <link>https://dev.to/manojms/create-a-basic-react-project-by-implementing-react-router-within-10-mins-pl5</link>
      <guid>https://dev.to/manojms/create-a-basic-react-project-by-implementing-react-router-within-10-mins-pl5</guid>
      <description>&lt;h3&gt;
  
  
  Prerequisites
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Basic knowledge of Html and JavaScript.&lt;/li&gt;
&lt;li&gt;Nodejs should be installed in your PC, if not you can install it &lt;a href="https://nodejs.org/en/"&gt;here&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Any code editor like VS Code, Atom etc.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Let’s get started
&lt;/h4&gt;

&lt;p&gt;Open your code editor, go to terminal, and navigate to path where you would like to create app and type&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx create-react-app demo-app
cd demo-app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Once it is finished navigate to src folder and delete all the files inside that and create Index.js and App.js files.&lt;/p&gt;

&lt;h5&gt;
  
  
  index.js
&lt;/h5&gt;

&lt;p&gt;It imports our App. js component which tells React where to render it (We will find this div element in our index. html file). To be more concise, react is for the components and react-dom is for rendering the components in the DOM.&lt;/p&gt;

&lt;p&gt;Open index.js and import React, ReactDom and App.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React from 'react';
import ReactDOM from 'react-dom';

import App from './App';

ReactDOM.render(&amp;lt;App /&amp;gt;, document.getElementById('root'));
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Next, in your App component,&lt;br&gt;
To use React Router, you first have to install it using NPM:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install react-router-dom
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;You'll need to import BrowserRouter, Route, and Switch from react-router-dom package:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React from "react";
import { BrowserRouter, Route, Switch } from "react-router-dom";
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Everything that gets rendered will need to go inside the BrowserRouter element, add the Switch element (open and closing tags). These ensure that only one component is rendered at a time. If we don't use this, we can default to the Error component, which we're going to write later.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const App = () =&amp;gt; {
  return (
    &amp;lt;BrowserRouter&amp;gt;
      &amp;lt;Switch&amp;gt;

      &amp;lt;/Switch&amp;gt;
    &amp;lt;/BrowserRouter&amp;gt;
  );
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;It's now time to add your  tags. These are the links between the components and should be placed inside the  tags.&lt;/p&gt;

&lt;p&gt;To tell the  tags which component to load, simply add a path attribute and the name of the component you want to load with component attribute.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;Route path='/' component={Home} /&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Many homepage URLs are the site name followed by "/", for example, &lt;a href="http://art-website.netlify.app/"&gt;http://art-website.netlify.app/&lt;/a&gt; In this case, we add exact to the Route tag. This is because the other URLs also contain "/", so if we don't tell the app that it needs to look for just /, it loads the first one to match the route, and we get a pretty tricky bug to deal with.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const App = () =&amp;gt; {
  return (
    &amp;lt;BrowserRouter&amp;gt;
      &amp;lt;Switch&amp;gt;
        &amp;lt;Route path="/" exact component={Home} /&amp;gt;
        &amp;lt;Route path="/about" component={About} /&amp;gt;
        &amp;lt;Route path="/contact" component={Contact} /&amp;gt;
      &amp;lt;/Switch&amp;gt;
    &amp;lt;/BrowserRouter&amp;gt;
  );
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Now import the components into the app and don’t forget to export App component.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React from "react";
import { BrowserRouter, Route, Switch } from "react-router-dom";
import Home from "./Components/Home";
import About from "./Components/About";
import Contact from "./Components/Contact";
import Error from "./Components/Error";

const App = () =&amp;gt; {
  return (
    &amp;lt;BrowserRouter&amp;gt;
      &amp;lt;Switch&amp;gt;
        &amp;lt;Route path="/" exact component={Home} /&amp;gt;
        &amp;lt;Route path="/about" component={About} /&amp;gt;
        &amp;lt;Route path="/contact" component={Contact} /&amp;gt;
        &amp;lt;Route component={Error} /&amp;gt;
      &amp;lt;/Switch&amp;gt;
    &amp;lt;/BrowserRouter&amp;gt;
  );
};
export default App;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;So far, our site is only navigable by typing the URLs. To add clickable links to the site, we use the Link element from React Router and set up a new Navbar component. Once again, don't forget to import the new component into the app.&lt;/p&gt;

&lt;p&gt;Now add a Link for each component in the app and use to="URL" to link them.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React from "react";
import { Link } from "react-router-dom";


const Navbar = () =&amp;gt; (
    &amp;lt;ul &amp;gt;
      &amp;lt;li &amp;gt;
        &amp;lt;Link to="/"&amp;gt; Home &amp;lt;/Link&amp;gt;
      &amp;lt;/li&amp;gt;
      &amp;lt;li &amp;gt;
        &amp;lt;Link to="/about"&amp;gt; About &amp;lt;/Link&amp;gt;
      &amp;lt;/li&amp;gt;
      &amp;lt;li &amp;gt;
        &amp;lt;Link to="/contact"&amp;gt; Contact &amp;lt;/Link&amp;gt;
      &amp;lt;/li&amp;gt;
    &amp;lt;/ul&amp;gt;
);

export default  Navbar;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;To display content in each component, Create a folder named Components and inside the folder create About.js, Home.js, Contact.js and Error.js files.&lt;/p&gt;

&lt;p&gt;In each component import React, import Navbar and create functional component and add the content which you want to show and export it after that.&lt;br&gt;
Example of Home.js is shown below.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React from 'react';
import Navbar from './navbar';
const Home =() =&amp;gt; {
    return (
        &amp;lt;div&amp;gt;
        &amp;lt;Navbar/&amp;gt;
        &amp;lt;div&amp;gt;
            &amp;lt;h1&amp;gt;
                Home Page
            &amp;lt;/h1&amp;gt;
        &amp;lt;/div&amp;gt;
        &amp;lt;/div&amp;gt;
    )
}

export default Home;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Save everything, open terminal and type&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;After compiling is complete you can see your app at&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="http://localhost:3000/"&gt;http://localhost:3000/&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;To build App for Porduction Build type&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm run build
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>react</category>
      <category>node</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
