<?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: Adewale Olaoye</title>
    <description>The latest articles on DEV Community by Adewale Olaoye (@dewaleolaoye).</description>
    <link>https://dev.to/dewaleolaoye</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%2F106734%2Fe4fbefd6-41af-4e44-a5ee-f3205bd0a9de.jpeg</url>
      <title>DEV Community: Adewale Olaoye</title>
      <link>https://dev.to/dewaleolaoye</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dewaleolaoye"/>
    <language>en</language>
    <item>
      <title>How to Setup Next.js with Typescript</title>
      <dc:creator>Adewale Olaoye</dc:creator>
      <pubDate>Wed, 11 Nov 2020 20:35:56 +0000</pubDate>
      <link>https://dev.to/dewaleolaoye/how-to-setup-next-js-with-typescript-8lb</link>
      <guid>https://dev.to/dewaleolaoye/how-to-setup-next-js-with-typescript-8lb</guid>
      <description>&lt;p&gt;I'm a big fan of Typescript and I love to use it with Next.js for any of my React projects no matter how small, I just love it. &lt;/p&gt;

&lt;p&gt;But I find myself googling for setup when I need it, and this has prompted me to write an article about it, I believe writing will also help me understand the setup better and hopefully help you too. &lt;/p&gt;

&lt;h2&gt;
  
  
  Setup
&lt;/h2&gt;

&lt;p&gt;First, let’s make sure that your development environment is ready.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You’ll need Node.js version 10.13 or later.
To check your Node.js version, simply type &lt;code&gt;node -v&lt;/code&gt; in your terminal. Or you can download the latest version &lt;a href="https://nodejs.org/en" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;P.S&lt;/strong&gt;: We will be using &lt;code&gt;yarn&lt;/code&gt; for this setup.&lt;/p&gt;

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

&lt;p&gt;Run &lt;code&gt;yarn create next-app&lt;/code&gt;&lt;br&gt;
You will be asked, "What is your project named?" Type in your project name and click enter (i.e. nextjs-typescript-starter).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1605116761358%2Fe7jGpo4rF.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1605116761358%2Fe7jGpo4rF.png" alt="Screenshot 2020-11-11 at 18.45.22.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2
&lt;/h2&gt;

&lt;p&gt;cd into the directory, for me it is &lt;code&gt;cd nextjs-typescript-starter&lt;/code&gt; and type &lt;code&gt;code .&lt;/code&gt; to open the project in vscode.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3
&lt;/h2&gt;

&lt;p&gt;We need to inform the project that we need typescript, hence we have to create a new file at the &lt;strong&gt;root&lt;/strong&gt; of our project. To do that,  type &lt;code&gt;touch tsconfig.json&lt;/code&gt; and hit enter. &lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4
&lt;/h2&gt;

&lt;p&gt;Install the necessary development dependencies &lt;br&gt;
&lt;code&gt;yarn add --dev typescript @types/react @types/node&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5
&lt;/h2&gt;

&lt;p&gt;Run &lt;code&gt;yarn dev&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1605117429958%2FctnGKfOUF.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1605117429958%2FctnGKfOUF.png" alt="Screenshot 2020-11-11 at 18.56.37.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;tsconfig&lt;/code&gt; file is automatically updated and that completes the setup.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;While I'm still learning how to use Typescript better in React apps, It's a tool I can't do without. &lt;br&gt;
Thank You for reading.&lt;/p&gt;

</description>
      <category>react</category>
      <category>typescript</category>
      <category>nextjs</category>
      <category>setup</category>
    </item>
  </channel>
</rss>
