<?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: Anson Low Z.F</title>
    <description>The latest articles on DEV Community by Anson Low Z.F (@ansonlowzf).</description>
    <link>https://dev.to/ansonlowzf</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%2F415209%2F69005198-7e16-4be1-b478-6e529077fc81.jpeg</url>
      <title>DEV Community: Anson Low Z.F</title>
      <link>https://dev.to/ansonlowzf</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ansonlowzf"/>
    <language>en</language>
    <item>
      <title>The Saddest Thing I Faced In Coding</title>
      <dc:creator>Anson Low Z.F</dc:creator>
      <pubDate>Thu, 06 Aug 2020 02:23:04 +0000</pubDate>
      <link>https://dev.to/ansonlowzf/the-saddest-thing-i-faced-in-coding-l7i</link>
      <guid>https://dev.to/ansonlowzf/the-saddest-thing-i-faced-in-coding-l7i</guid>
      <description>&lt;p&gt;No matter how long time I learned,&lt;br&gt;
No matter how hard I learned,&lt;br&gt;
No matter what I had learned.&lt;/p&gt;

&lt;p&gt;I feel like not moving forward~&lt;br&gt;
Like I'm stuck in beginner level for a long time~&lt;br&gt;
I still don't know how to code well.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I code slow,&lt;/li&gt;
&lt;li&gt;Research takes me at least half-day or a few days,&lt;/li&gt;
&lt;li&gt;Don't know how to write the code without referencing the doc,&lt;/li&gt;
&lt;li&gt;Some bugs like forever don't know how to settle, end up delete the entire project and start over again,&lt;/li&gt;
&lt;li&gt;Not sure my code is right or not, it's seen working but the UI seen like something went wrong,&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Are you facing the same situation?&lt;br&gt;
What obstacle are you facing?&lt;/p&gt;

&lt;p&gt;"Btw, I'm still proud of myself for starting my journey as a self-taught developer."&lt;/p&gt;

</description>
      <category>discuss</category>
    </item>
    <item>
      <title>Explore Gatsby Theme Blog 2.0</title>
      <dc:creator>Anson Low Z.F</dc:creator>
      <pubDate>Mon, 27 Jul 2020 00:46:36 +0000</pubDate>
      <link>https://dev.to/ansonlowzf/explore-gatsby-theme-blog-2-0-23ge</link>
      <guid>https://dev.to/ansonlowzf/explore-gatsby-theme-blog-2-0-23ge</guid>
      <description>&lt;p&gt;I started my blog in April 2020 by using &lt;a href="https://github.com/gatsbyjs/gatsby/tree/master/starters/gatsby-starter-blog-theme" rel="noopener noreferrer"&gt;gatsby-starter-blog-theme&lt;/a&gt;. The good thing is out of the box; I could immediately begin writing a blog with the starter. The bad part is I not learning how to set up a blog theme with gatsby.&lt;/p&gt;

&lt;p&gt;Gatsby release gatsby-theme-blog 2.0 in the second week of July 2020. I want to take this opportunity to learn the setup from scratch.&lt;/p&gt;

&lt;p&gt;Let's get started.&lt;/p&gt;

&lt;h2&gt;
  
  
  Initial A Project With Gatsby Starter
&lt;/h2&gt;

&lt;p&gt;I use the simplified bare-bones starter for this new blog site - &lt;a href="https://www.gatsbyjs.org/starters/gatsbyjs/gatsby-starter-hello-world/" rel="noopener noreferrer"&gt;gatsby-starter-hello-world&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Open any terminal&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;desktop //cd to the folder where you want to save the project.

gatsby new ansonlowzf-blog2.0 https://github.com/gatsbyjs/gatsby-starter-hello-world

&lt;span class="nb"&gt;cd &lt;/span&gt;ansonwlowzf-blog2.0

gatsby develop
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Note:-&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If you are new to Gatsby, make sure you install gatsby-cli globally in your machine follow this &lt;a href="https://www.gatsbyjs.org/docs/quick-start/" rel="noopener noreferrer"&gt;guide&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;ansonlowzf-blog2.0 is the name I choose for my blog, and you should use the name you want for your project.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I can see "Hello world!" appear in the browser.&lt;/p&gt;

&lt;h2&gt;
  
  
  Install gatsby-theme-blog
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Ctrl + C&lt;/em&gt;&lt;/strong&gt; to stop the local development server then go to the terminal&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install &lt;/span&gt;gatsby-theme-blog

npm update 

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I always like to update all the modules to the latest.😊&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;code &lt;span class="nb"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Open the file in VS Code&lt;/p&gt;

&lt;h2&gt;
  
  
  Configure Gatsby-config File
&lt;/h2&gt;

&lt;p&gt;Open &lt;strong&gt;gatsby-config.js&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You shall see something like below:-&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;exports&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="cm"&gt;/* Your site config here */&lt;/span&gt;
  &lt;span class="na"&gt;plugins&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[],&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add gatsby-theme-blog as a plugin&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;exports&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="cm"&gt;/* Your site config here */&lt;/span&gt;
  &lt;span class="na"&gt;plugins&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;`gatsby-theme-blog`&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save the file and run:-&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gatsby develop
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You shall see a content folder appear in the root directory&lt;/p&gt;

&lt;p&gt;Inside the content folder, there are:-&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;assets folder - to keep the blog images&lt;/li&gt;
&lt;li&gt;posts folder - to write the blog post in Markdown&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Ctrl + C&lt;/em&gt;&lt;/strong&gt; to stop the local development server&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note:-&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;No need to visit &lt;a href="http://localhost:8000/" rel="noopener noreferrer"&gt;http://localhost:8000/&lt;/a&gt; to check anything yet. We just want gatsby-theme-blog to generate a &lt;strong&gt;content&lt;/strong&gt; folder for us.&lt;/p&gt;

&lt;h2&gt;
  
  
  Create The First Blog Post
&lt;/h2&gt;

&lt;p&gt;Create &lt;strong&gt;/content/posts/my-first-post.md&lt;/strong&gt; and add the following code:-&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fyvdrra7nv1o4vd9dqc54.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fyvdrra7nv1o4vd9dqc54.png" alt="first blog post content"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Delete &lt;strong&gt;src/pages/index.js&lt;/strong&gt; (This is important especially you want to render your blog list in index page.)&lt;/p&gt;

&lt;p&gt;Save the file and run:-&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gatsby develop
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Visit &lt;a href="http://localhost:8000/" rel="noopener noreferrer"&gt;http://localhost:8000/&lt;/a&gt; in the browser&lt;/p&gt;

&lt;p&gt;You shall see something similar to:-&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fky0g694leuragadt83t7.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fky0g694leuragadt83t7.png" alt="Blog list in index page"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As simple as that, a blog list in index page. 😊&lt;/p&gt;

&lt;p&gt;You might already notice, my footer is different from yours, why?&lt;/p&gt;

&lt;p&gt;Check out the next step.&lt;/p&gt;

&lt;h2&gt;
  
  
  Set Up Site Metadata
&lt;/h2&gt;

&lt;p&gt;This site metadata I copy from my previous blog, you can also copy from the "&lt;a href="https://www.gatsbyjs.org/packages/gatsby-theme-blog/" rel="noopener noreferrer"&gt;gatsby-theme-blog&lt;/a&gt;" site and look for "additional configuration", or you can copy the code below and paste it after the &lt;strong&gt;plugins&lt;/strong&gt; and change to your data accordingly.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;exports&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="cm"&gt;/* Your site config here */&lt;/span&gt;
  &lt;span class="na"&gt;plugins&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[...&lt;/span&gt;&lt;span class="nx"&gt;code&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="na"&gt;siteMetadata&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`Anson LowZF Blog`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;author&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`Anson LowZF`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`A self taught front-end developer documenting and sharing his learning process`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;siteUrl&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`https://ansonlowzf.com`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;social&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
      &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`Twitter`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`https://twitter.com/ansonlowzf`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="p"&gt;},&lt;/span&gt;
      &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`Github`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`https://github.com/ansonlowzf`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="p"&gt;},&lt;/span&gt;
      &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`Proudly hosted on Netlify`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`https://www.netlify.com/`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save the file and run:-&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gatsby develop
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, you shall see the footer content change according to your data.&lt;/p&gt;

&lt;h2&gt;
  
  
  Shadowing The Bio Content
&lt;/h2&gt;

&lt;p&gt;Click &lt;strong&gt;My First Post&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You shall see:-&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fdqkfqyu6m4glnxaku7s5.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fdqkfqyu6m4glnxaku7s5.png" alt="first blog post"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I would like to amend this part:-&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F6ua2cmfzwk497ns38xmi.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F6ua2cmfzwk497ns38xmi.png" alt="Highlight the bio content with red box"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the gatsby theme, we just need to find out which component render this part and overwrite it. This is called &lt;strong&gt;shadowing&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Create &lt;strong&gt;/src/gatsby-theme-blog/components/bio-content.jsx&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;How do I know to create this file could overwrite the bio content?&lt;/p&gt;

&lt;p&gt;Check out the shadowing &lt;a href="https://www.gatsbyjs.org/docs/themes/shadowing/" rel="noopener noreferrer"&gt;guide&lt;/a&gt; by Gatsby.&lt;/p&gt;

&lt;p&gt;I find out which component is rendering the bio content part in gatsby theme blog's &lt;a href="https://github.com/gatsbyjs/themes/tree/master/packages/gatsby-theme-blog/src/components" rel="noopener noreferrer"&gt;Github&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Check out the components, I find out the bio content component is rendering the part mentioned. The code is as below:- (Check gatsby theme blog's &lt;a href="https://github.com/gatsbyjs/themes/blob/master/packages/gatsby-theme-blog/src/components/bio-content.js" rel="noopener noreferrer"&gt;Github&lt;/a&gt;)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Fragment&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Styled&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;theme-ui&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;

&lt;span class="cm"&gt;/**
 * Shadow me to add your own bio content
 */&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;BioContent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Fragment&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nx"&gt;Words&lt;/span&gt; &lt;span class="nx"&gt;by&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Styled&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="nx"&gt;href&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;http://example.com/&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Jane&lt;/span&gt; &lt;span class="nx"&gt;Doe&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/Styled.a&amp;gt;&lt;/span&gt;&lt;span class="err"&gt;.
&lt;/span&gt;    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;br&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nx"&gt;Change&lt;/span&gt; &lt;span class="nx"&gt;me&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt; &lt;span class="nx"&gt;This&lt;/span&gt; &lt;span class="nx"&gt;is&lt;/span&gt; &lt;span class="nx"&gt;all&lt;/span&gt; &lt;span class="nx"&gt;quite&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/Fragment&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;BioContent&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;See the file above, very obvious right?&lt;/p&gt;

&lt;p&gt;I shadowing the &lt;strong&gt;bio-content.jsx&lt;/strong&gt; with my code as below:-&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Styled&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;theme-ui&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;BioContent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&amp;gt;&lt;/span&gt;
    &lt;span class="nx"&gt;A&lt;/span&gt; &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;taught&lt;/span&gt; &lt;span class="nx"&gt;developer&lt;/span&gt; &lt;span class="nx"&gt;documenting&lt;/span&gt; &lt;span class="nx"&gt;and&lt;/span&gt; &lt;span class="nx"&gt;sharing&lt;/span&gt; &lt;span class="nx"&gt;his&lt;/span&gt; &lt;span class="nx"&gt;learning&lt;/span&gt; &lt;span class="nx"&gt;experience&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;br&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;js&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="nx"&gt;bull&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;Gatsby&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;js&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="nx"&gt;bull&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;Next&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;js&lt;/span&gt; &lt;span class="nx"&gt;soon&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt; &lt;span class="nx"&gt;More&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt; &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Styled&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="nx"&gt;href&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/about-me&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;about&lt;/span&gt; &lt;span class="nx"&gt;me&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/Styled.a&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;BioContent&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save the file, and restart the development server.&lt;/p&gt;

&lt;p&gt;You shall see:-&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fwnog8z6uju7a345qacf3.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fwnog8z6uju7a345qacf3.png" alt="The bio content change to my information"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Add Avatar
&lt;/h2&gt;

&lt;p&gt;If you check the bio compnent source code:-&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F47udso79rsup31g3h5rl.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F47udso79rsup31g3h5rl.png" alt="bio avatar source code"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As long as you name your image &lt;strong&gt;avatar&lt;/strong&gt; with jpeg, jpg, gif or png extension and put in the asset folder, it will pass to &lt;strong&gt;bio&lt;/strong&gt; component. (Check out the &lt;a href="https://github.com/gatsbyjs/themes/blob/master/packages/gatsby-theme-blog/src/components/bio.js" rel="noopener noreferrer"&gt;source code&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;I grab a handsome face photo, rename it to avatar.jpg and drag to the assets folder.&lt;/p&gt;

&lt;p&gt;Restart the development server&lt;/p&gt;

&lt;p&gt;Tada~&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fg3ttneoniwjqn6li7pb8.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fg3ttneoniwjqn6li7pb8.png" alt="My avatar show up in bio content"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If your avatar not showing up, try &lt;code&gt;gatsby clean&lt;/code&gt; to delete the cache file and start the development server again.&lt;/p&gt;

&lt;h2&gt;
  
  
  Change The Site's Font
&lt;/h2&gt;

&lt;p&gt;The default system-ui font looks a bit skinny and un-organized for me.&lt;/p&gt;

&lt;p&gt;I want to change to Roboto. How to change it?&lt;/p&gt;

&lt;p&gt;Create &lt;strong&gt;src/gatsby-plugin-theme-ui/index.js&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;fonts&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`Roboto, "Helvetica Neue", sans-serif`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save the file, and you'll see the entire website change to Roboto font.&lt;/p&gt;

&lt;p&gt;You may ask why we don't need to import Roboto font in the first place?&lt;/p&gt;

&lt;p&gt;If you check the &lt;a href="https://github.com/gatsbyjs/themes/blob/master/packages/gatsby-theme-ui-preset/src/index.js" rel="noopener noreferrer"&gt;source code&lt;/a&gt;, you'll notice Roboto font already built into gatsby theme blog.&lt;/p&gt;

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

&lt;p&gt;It's not much different compare to version 1.&lt;/p&gt;

&lt;p&gt;I'll continue to explore gatsby-theme-blog 2.0 and write my experience about it.&lt;/p&gt;

&lt;p&gt;(I'm a new to writing, if you found any part I can improve or mistake, please leave me a comment. Thank you in advance)&lt;/p&gt;

</description>
      <category>gatsby</category>
      <category>react</category>
    </item>
    <item>
      <title>Learning To Be A Mouse-Less Web Developer In VS Code (Updated: 22 July 2020)</title>
      <dc:creator>Anson Low Z.F</dc:creator>
      <pubDate>Mon, 29 Jun 2020 06:50:08 +0000</pubDate>
      <link>https://dev.to/ansonlowzf/learning-to-be-a-mouse-less-web-developer-7em</link>
      <guid>https://dev.to/ansonlowzf/learning-to-be-a-mouse-less-web-developer-7em</guid>
      <description>&lt;p&gt;Updated: &lt;strong&gt;22 July 2020&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Add "Clear the terminal inside VS Code"&lt;/li&gt;
&lt;li&gt;Add "Backward and Forward" (Essential)&lt;/li&gt;
&lt;li&gt;Add "Move a line up or down"&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Updated: &lt;strong&gt;02 July 2020&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Add "select a line" shortcut &lt;/li&gt;
&lt;li&gt;Add "toggle the problem panel"&lt;/li&gt;
&lt;li&gt;Remove and organise the import modules&lt;/li&gt;
&lt;li&gt;Navigate between terminal&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Note: Select the title inside the quote and use &lt;strong&gt;&lt;em&gt;Ctrl + F&lt;/em&gt;&lt;/strong&gt; to quickly find the newly added section&lt;/p&gt;




&lt;p&gt;After using PC for so many years with a mouse or trackpad, we so used to point and click everything we want on the screen so fast and concise. Drag and drop, left-click, right-click, scroll the web page up and down with mouse wheel.&lt;/p&gt;

&lt;p&gt;There are some arguments in the web development community mention that writing code without a mouse could be faster.&lt;/p&gt;

&lt;p&gt;I'm curious to try it out. My target is to focus 90% on using the keyboard. I don't think we can 100% avoid using a mouse in a graphic user interface (GUI) environment, especially when we want to check the navigation link, button and form.&lt;/p&gt;

&lt;p&gt;I will try my best to use the keyboard shortcut, terminal and command line in VS Code. Then document my learning to be a mouse free developer (Ops, it's should be a mouse-less developer).&lt;/p&gt;

&lt;p&gt;I not sure I can get used to it or not. What I pretty sure is my coding speed will decrease dramatically. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If you could also share how you code without using a mouse would be much appreciated. Let's learn together.&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;Below are the keyboard shortcut and navigation I learned so far, I'll continuously update this article when I learn something new.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;--First Few Days--&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;I use mouse unconsciously, and I always have to remind myself not to use it.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;--Change Cursor Colour--&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;I change my cursor colour to yellow. So, I can see it easily.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;--Open a file--&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Method 1&lt;/strong&gt;: Use &lt;strong&gt;Go To File&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I often toggle the sidebar off with &lt;strong&gt;&lt;em&gt;Ctrl + B&lt;/em&gt;&lt;/strong&gt;. I navigate from file to file with &lt;strong&gt;&lt;em&gt;Ctrl + E&lt;/em&gt;&lt;/strong&gt; (you can also use &lt;strong&gt;&lt;em&gt;Ctrl + P&lt;/em&gt;&lt;/strong&gt;) then search the keyword of the filename and press &lt;strong&gt;&lt;em&gt;Enter&lt;/em&gt;&lt;/strong&gt; to open a file.&lt;/p&gt;

&lt;p&gt;Example:-&lt;br&gt;
Your filename is &lt;strong&gt;how-to-build-a-website-with-gatsbyjs.md&lt;/strong&gt;, you can type &lt;strong&gt;gatsbyjs&lt;/strong&gt; or &lt;strong&gt;build a website&lt;/strong&gt;, VS Code will filter and show you every file match your search.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Method 2:&lt;/strong&gt; Use &lt;strong&gt;Breadcrumbs&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;&lt;em&gt;Ctrl + Shift + . (Period)&lt;/em&gt;&lt;/strong&gt; to focus your current breadcrumbs folder.&lt;br&gt;
Use &lt;strong&gt;&lt;em&gt;Ctrl + right/left arrow&lt;/em&gt;&lt;/strong&gt; to navigate between folder.&lt;br&gt;
Use &lt;strong&gt;&lt;em&gt;up/down arrow&lt;/em&gt;&lt;/strong&gt; to navigate between the file.&lt;br&gt;
Press &lt;strong&gt;&lt;em&gt;Enter&lt;/em&gt;&lt;/strong&gt; to open a file.&lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;--Navigate between editor and explorer--&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;I seldom navigate folder and file this way. I share this method with people who might find it useful.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Method 1&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Ctrl + Shift + E&lt;/em&gt;&lt;/strong&gt; to focus on the explorer and &lt;strong&gt;&lt;em&gt;Ctrl + Shift + E&lt;/em&gt;&lt;/strong&gt; again to focus back to the editor. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use the &lt;strong&gt;&lt;em&gt;up/down arrow&lt;/em&gt;&lt;/strong&gt; to navigate between the file or folder. &lt;/li&gt;
&lt;li&gt;Use the &lt;strong&gt;&lt;em&gt;left arrow&lt;/em&gt;&lt;/strong&gt; to go up one directory, and right arrow to go inside a directory. &lt;/li&gt;
&lt;li&gt;Press &lt;strong&gt;&lt;em&gt;Enter&lt;/em&gt;&lt;/strong&gt; to open a file.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Method 2&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Ctrl + 0 (Zero)&lt;/em&gt;&lt;/strong&gt; (not working in number pad) to focus on explorer, &lt;strong&gt;&lt;em&gt;Ctrl + 1&lt;/em&gt;&lt;/strong&gt; (not working in number pad) to focus back to the editor&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use the &lt;strong&gt;&lt;em&gt;up/down arrow&lt;/em&gt;&lt;/strong&gt; to navigate between the file or folder. &lt;/li&gt;
&lt;li&gt;Use the &lt;strong&gt;&lt;em&gt;left arrow&lt;/em&gt;&lt;/strong&gt; to go up one directory, and right arrow to go inside a directory. &lt;/li&gt;
&lt;li&gt;Press Enter to open a file.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;--Navigate between the editor's tab--&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Method 1&lt;/strong&gt;&lt;br&gt;
I use &lt;strong&gt;&lt;em&gt;Ctrl + PgUp&lt;/em&gt;&lt;/strong&gt; to focus on the previous tab and &lt;strong&gt;&lt;em&gt;Ctrl + PgDn&lt;/em&gt;&lt;/strong&gt; to focus on the next tab.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Method 2&lt;/strong&gt;&lt;br&gt;
You can use &lt;strong&gt;&lt;em&gt;Ctrl + Tab&lt;/em&gt;&lt;/strong&gt; to focus on the next tab or &lt;strong&gt;&lt;em&gt;Ctrl + Shift + Tab&lt;/em&gt;&lt;/strong&gt; to focus on the previous tab.&lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;--Close a tab--&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;Ctrl + W&lt;/em&gt;&lt;/strong&gt; to close the current tab&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;--Delete entire line--&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Method 1&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Press &lt;strong&gt;&lt;em&gt;Backspace&lt;/em&gt;&lt;/strong&gt; deletes one character to the left&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Method 2&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Press &lt;strong&gt;&lt;em&gt;Delete&lt;/em&gt;&lt;/strong&gt; on the keyboard delete one character to the right&lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;--Delete a word--&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;Ctrl + D&lt;/em&gt;&lt;/strong&gt; to select a word (whether you are in front, back or within the word), press &lt;strong&gt;&lt;em&gt;Delete&lt;/em&gt;&lt;/strong&gt; in the keyboard to remove the word.&lt;/li&gt;
&lt;li&gt;Place your cursor at the end of the word you want to delete, then &lt;strong&gt;&lt;em&gt;Ctrl + Backspace&lt;/em&gt;&lt;/strong&gt; to delete the word.&lt;/li&gt;
&lt;li&gt;Place your cursor in front of the word, and then &lt;strong&gt;&lt;em&gt;Ctrl + Delete&lt;/em&gt;&lt;/strong&gt; to delete the word.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;--Insert a new line--&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;Ctrl + Enter&lt;/em&gt;&lt;/strong&gt; to move my cursor to a new line (go down 1 line).
&lt;strong&gt;&lt;em&gt;Ctrl + Shift + Enter&lt;/em&gt;&lt;/strong&gt; to push existing line down and add a new line. &lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;--Select a line--&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;Ctrl + L&lt;/em&gt;&lt;/strong&gt; to select the entire line&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;--Moving cursor in the editor--&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;(Sorry for including this basic)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The &lt;strong&gt;&lt;em&gt;right arrow&lt;/em&gt;&lt;/strong&gt; moves one character to the right &lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;&lt;em&gt;left arrow&lt;/em&gt;&lt;/strong&gt; moves one character to the left &lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;&lt;em&gt;up arrow&lt;/em&gt;&lt;/strong&gt; moves the cursor up one line&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;&lt;em&gt;down arrow&lt;/em&gt;&lt;/strong&gt; moves the cursor down one line&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;--Move a line up or down--&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Instead of &lt;strong&gt;&lt;em&gt;Ctrl + X&lt;/em&gt;&lt;/strong&gt; to cut a line and &lt;strong&gt;&lt;em&gt;Ctrl + V&lt;/em&gt;&lt;/strong&gt; to paste a line, you could use &lt;strong&gt;_Alt + Up/Down Arrow _&lt;/strong&gt; to move a line up or down&lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;--Moving cursor by word--&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;Ctrl + right arrow&lt;/em&gt;&lt;/strong&gt; moves the cursor to the end of a word&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;Ctrl + left arrow&lt;/em&gt;&lt;/strong&gt; move the cursor to the beginning of a word&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;--Moving cursor by section--&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;Home&lt;/em&gt;&lt;/strong&gt; in the keyboard move cursor to the beginning of a line&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;End&lt;/em&gt;&lt;/strong&gt; in the keyboard move cursor to the end of a line&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;Ctrl + Home&lt;/em&gt;&lt;/strong&gt; move the cursor to the beginning of the page&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;Ctrl + End&lt;/em&gt;&lt;/strong&gt; move the cursor to the end of the page&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;PgUp&lt;/em&gt;&lt;/strong&gt; moves the cursor to the top of the editor.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;PgDn&lt;/em&gt;&lt;/strong&gt; moves the cursor to the bottom of the editor. &lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;I use it to scroll editor sometime.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;--Select a word--&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Method 1&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Ctrl + D&lt;/em&gt;&lt;/strong&gt; to select a word&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Method 2&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;Ctrl + Shift + Right Arrow&lt;/em&gt;&lt;/strong&gt; to select a word toward the right&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;Ctrl + Shift + Left Arrow&lt;/em&gt;&lt;/strong&gt; to select a word toward the left&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;--Move and select a word--&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;Ctrl + Shift + right arrow&lt;/em&gt;&lt;/strong&gt; move the cursor and select the word toward the right.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;Ctrl + Shift + left arrow&lt;/em&gt;&lt;/strong&gt; move the cursor and select the word toward left.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;--Scroll the editor--&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;Ctrl + up arrow&lt;/em&gt;&lt;/strong&gt; to scroll one line up.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;Ctrl + down arrow&lt;/em&gt;&lt;/strong&gt; to scroll one line down. &lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;I use it to adjust the editor view.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;--Open the Terminal inside VS Code--&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Ctrl + `(backtick)&lt;/em&gt;&lt;/strong&gt; toggle terminal panel on &amp;amp; off&lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;--Open Terminal side by side--&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;Ctrl + shift + 5&lt;/em&gt;&lt;/strong&gt; to open second terminal&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;--Navigate between terminal--&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;Alt + right/left arrow&lt;/em&gt;&lt;/strong&gt; to navigate between the terminal. &lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;--Open an external Terminal--&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;If you always forget to stop the development server before closing the VS Code. &lt;/p&gt;

&lt;p&gt;Use &lt;strong&gt;&lt;em&gt;Ctrl + Shift + C&lt;/em&gt;&lt;/strong&gt; to open an external terminal&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;if you want to change external terminal, Open VS Code setting and search &lt;strong&gt;External: Windows Exec&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;--Clear the terminal inside VS Code--&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Type &lt;strong&gt;&lt;em&gt;clear&lt;/em&gt;&lt;/strong&gt; and press &lt;strong&gt;&lt;em&gt;Enter&lt;/em&gt;&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;Ctrl + L&lt;/em&gt;&lt;/strong&gt; in the terminal&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;--Show All Command--&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Method 1&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Ctrl + Shift + P&lt;/em&gt;&lt;/strong&gt; to see all commands&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Method 2&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I prefer pressing &lt;strong&gt;&lt;em&gt;F1&lt;/em&gt;&lt;/strong&gt; to see all commands&lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;--Toggle the problems panel--&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;When you see your file become red colour, VS Code detects a problem in your file.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;Ctrl + Shirt + M&lt;/em&gt;&lt;/strong&gt; to focus on the problems panel.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;--Remove and organise the import modules--&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;After you remove some components, usually, you need to remove the import module manually.&lt;/p&gt;

&lt;p&gt;You can remove those un-used components or modules automatically by pressing Alt + Shift + O.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The drawback&lt;/strong&gt;&lt;br&gt;
VS Code organise all import statement in its preference way. I like to put react import statement at the top. But, after pressing Alt + Shift + O, En... maybe you try it see whether you like it or not. &lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;--Backward and Forward--&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Imagine you are in line 1034, and you want to import a module at the top of the editor. You Ctrl + Home to navigate to the top and import the module. How are you going back to line 1034?&lt;/p&gt;

&lt;p&gt;You might need to remember the line number and use Ctrl + G option. What if you don't want to squeeze your memory muscle to remember the line number?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You can use &lt;strong&gt;&lt;em&gt;Alt + Left Arrow&lt;/em&gt;&lt;/strong&gt; to backward (This does not change and undo anything, it just back to previous location or action)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Why did I say it also back to the previous action?&lt;/p&gt;

&lt;p&gt;If your previous action is select a line, at this moment, you navigate to the top and then Alt + Left Arrow. It will back to select a line.&lt;/p&gt;

&lt;p&gt;Please note that if you in file 1, and you go to file 2 and import a module. At this moment, you Alt + Left Arrow. You will go back to file 1.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Alt + Right Arrow&lt;/em&gt;&lt;/strong&gt; to go forward&lt;/p&gt;



&lt;p&gt;I want to continue writing, but dev.to fenced block syntax highlighting is not working. &lt;/p&gt;

&lt;p&gt;Below is the result I get:-&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;`html&lt;/p&gt;


  
    &lt;a&gt;I'm a button&lt;/a&gt;
  


&lt;p&gt;`&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;I not sure how to fix it, could anyone give me some hint or guide me to fix it?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;(I end up putting 4 back-tick above and 3 back-tick below to make the fenced block syntax highlight work.&lt;/p&gt;

&lt;p&gt;`&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;article&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;a&amp;gt;&lt;/span&gt;I'm a button&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/article&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Dev.to's team, what is happening?&lt;/p&gt;

&lt;p&gt;I'll continue...&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;--Emmet--&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;article&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;a&amp;gt;&lt;/span&gt;I'm a button&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/article&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
```



**Remove Tag**
I want to remove the article tag. 

1. Place the cursor inside the tag until the beginning and the ending tag is glowing. 
2. Press **_F1_**
3. Type **remove tag**
4. Press **_Enter_**

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/kltt1kv3vp7oqvkzsgq1.png)


**Update Tag**
Same concept above

**Wrap with Abbreviation**

I want to wrap the word "link" with an anchor tag.



```
&lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;Please check out this link&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
```



1. Put the cursor in front the word "link"
2. **_Ctrl + D_** to select the word
3. Press **_F1_** and type **wrap**
   ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/8s5hup911otx77ux9o9c.png)
4. Type **"a"** and press **_Enter_**

Thank you for reading~

**Hi, Do you have any similar tips could share with me?**
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>vscode</category>
      <category>webdev</category>
      <category>productivity</category>
      <category>beginners</category>
    </item>
    <item>
      <title>How To Create React Parallax Effect With React Hooks</title>
      <dc:creator>Anson Low Z.F</dc:creator>
      <pubDate>Wed, 24 Jun 2020 09:10:02 +0000</pubDate>
      <link>https://dev.to/ansonlowzf/how-to-create-react-parallax-effect-with-react-hooks-1fon</link>
      <guid>https://dev.to/ansonlowzf/how-to-create-react-parallax-effect-with-react-hooks-1fon</guid>
      <description>&lt;p&gt;This is my first post in Dev. Thank you for reading~&lt;/p&gt;

&lt;p&gt;I want to create a hero section with parallax scrolling effect, the text and image move at a different speed without using any library.&lt;/p&gt;

&lt;p&gt;It’s easy to do with vanilla JavaScript:-&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Target parallax container and slow down image's Yoffset for 50%&lt;/span&gt;
&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;scroll&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;parallax&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;.parallax&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;scrollPosition&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;pageYOffset&lt;/span&gt;

  &lt;span class="nx"&gt;parallax&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;transform&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`translateY(&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;scrollPosition&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mf"&gt;0.5&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;px)`&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;What if I want to implement the same code in React? I'm stuck for quite some time.&lt;/p&gt;

&lt;p&gt;I googled around, most of the guides, tutorials and articles are using:-&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://www.npmjs.com/package/react-parallax"&gt;React-parallax&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.react-spring.io/"&gt;React Spring&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.framer.com/motion/"&gt;Framer Motion &lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;When I try to a find solution in Stack Overflow. Most of the solution is either in Class component or React Refs code.&lt;/p&gt;

&lt;p&gt;I started to learn React around mid of the year 2019. It’s the React Hooks era. I skipped learning Class component. Hence, I not sure how to resolve Class component and convert it to a functional component with React Hooks.&lt;/p&gt;




&lt;h2&gt;
  
  
  Create Parallax React Component
&lt;/h2&gt;

&lt;p&gt;I want to write the Parallax JavaScript code in React Hero component. How to do it?&lt;/p&gt;

&lt;p&gt;Convert HTML mark up to JSX:-&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;App&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;section&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hero&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;img&lt;/span&gt;
      &lt;span class="nx"&gt;src&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://picsum.photos/800/600&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
      &lt;span class="nx"&gt;alt&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;test&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
      &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;parallax&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
    &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;text-wrapper&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;h1&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;headline&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Parallax&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/h1&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;h2&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;sub-headline&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Scrolling&lt;/span&gt; &lt;span class="nx"&gt;effect&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/h2&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/section&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;






&lt;h2&gt;
  
  
  My First Try
&lt;/h2&gt;

&lt;p&gt;I thought I can just wrap the JavaScript code with parentheses, like how we execute JavaScript code in JSX:-&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;App&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;section&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hero&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;img&lt;/span&gt;
      &lt;span class="nx"&gt;src&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://picsum.photos/800/600&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
      &lt;span class="nx"&gt;alt&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;test&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
      &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;parallax&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
    &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;text-wrapper&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;h1&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;headline&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Parallax&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/h1&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;h2&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;sub-headline&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Scrolling&lt;/span&gt; &lt;span class="nx"&gt;effect&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/h2&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/section&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="c"&gt;&amp;lt;!--&lt;/span&gt; &lt;span class="nx"&gt;Make&lt;/span&gt; &lt;span class="nx"&gt;space&lt;/span&gt; &lt;span class="nx"&gt;to&lt;/span&gt; &lt;span class="nx"&gt;scroll&lt;/span&gt; &lt;span class="o"&gt;--&amp;gt;&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;section&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;overflow&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/section&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;scroll&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;parallax&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;.parallax&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;scrollPosition&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;pageYOffset&lt;/span&gt;

  &lt;span class="nx"&gt;parallax&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;transform&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`translateY(&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;scrollPosition&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mf"&gt;0.5&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;px)`&lt;/span&gt;
&lt;span class="p"&gt;})}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Of course, it's failed! What a genius!&lt;/p&gt;




&lt;h2&gt;
  
  
  Second Try
&lt;/h2&gt;

&lt;p&gt;I continue my research and read more article. Oh, I see, if I want to addEventListener, I should write the parallax code in useEffect Hooks.&lt;/p&gt;

&lt;p&gt;Without thinking further, I insert the parallax code in:-&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;App&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

  &lt;span class="nx"&gt;useEffect&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;scroll&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;parallax&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;.parallax&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;scrollPosition&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;pageYOffset&lt;/span&gt;

  &lt;span class="nx"&gt;parallax&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;transform&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`translateY(&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;scrollPosition&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mf"&gt;0.5&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;px)`&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;[]);&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;App&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;section&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hero&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;img&lt;/span&gt;
          &lt;span class="nx"&gt;src&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://picsum.photos/800/600&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
          &lt;span class="nx"&gt;alt&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;test&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
          &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;parallax&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
          &lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{{&lt;/span&gt;
            &lt;span class="na"&gt;transform&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`translateY(&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;offset&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mf"&gt;0.5&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;px)`&lt;/span&gt;
          &lt;span class="p"&gt;}}&lt;/span&gt;
        &lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;text-wrapper&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
          &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;h1&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;headline&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Parallax&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/h1&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;          &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;h2&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;sub-headline&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Scrolling&lt;/span&gt; &lt;span class="nx"&gt;effect&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/h2&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/section&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;I have lousy React fundamental. I'm sad!&lt;/p&gt;




&lt;h2&gt;
  
  
  Final Try Before Asking For Help
&lt;/h2&gt;

&lt;p&gt;More googling with different keywords,&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;React parallax effect&lt;/li&gt;
&lt;li&gt;parallax scroll&lt;/li&gt;
&lt;li&gt;parallax with React Hooks&lt;/li&gt;
&lt;li&gt;scrolling in React&lt;/li&gt;
&lt;li&gt;React onScroll event&lt;/li&gt;
&lt;li&gt;More&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Continue reading more articles. This time, I feel like more pro in React now. Yes, I can do it! Just do it! Come on!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;MyApp&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;offset&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setOffset&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

  &lt;span class="nx"&gt;useEffect&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;onscroll&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;setOffset&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;pageYOffset&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;[])&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;App&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;section&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hero&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;img&lt;/span&gt;
          &lt;span class="nx"&gt;src&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://picsum.photos/800/600&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
          &lt;span class="nx"&gt;alt&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;test&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
          &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;parallax&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
          &lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{{&lt;/span&gt;
            &lt;span class="na"&gt;transform&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`translateY(&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;offset&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mf"&gt;0.5&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;px)`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="p"&gt;}}&lt;/span&gt;
        &lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;text-wrapper&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
          &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;h1&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;headline&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Parallax&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/h1&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;          &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;h2&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;sub-headline&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Scrolling&lt;/span&gt; &lt;span class="nx"&gt;effect&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/h2&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/section&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;En~ then what? Where should I write the parallax code? Oh my god, I'm despair. &lt;/p&gt;




&lt;h2&gt;
  
  
  Asking For Help
&lt;/h2&gt;

&lt;p&gt;I need to trouble my big brother again, &lt;a href="https://twitter.com/Malcolm_Kee"&gt;Malcolm Kee&lt;/a&gt;. He is a React expert and a fanatic. He always guides and helps React beginner in my country - Malaysia. He organises &lt;a href="https://www.kl-react.com/"&gt;React KL's meetup&lt;/a&gt; to gather React developers and share tips and tricks and latest information about React to the Kuala Lumpur React's community.&lt;/p&gt;

&lt;p&gt;I reach him out with Twitter and send my code to him though CodeSandbox.&lt;/p&gt;

&lt;p&gt;He replies me the following with code:-&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useEffect&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;useState&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;./styles.css&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;App&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;offset&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setOffset&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

  &lt;span class="nx"&gt;useEffect&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;handleScroll&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;setOffset&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;pageYOffset&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;scroll&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;handleScroll&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;removeEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;scroll&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;handleScroll&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;[])&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;App&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;section&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hero&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;img&lt;/span&gt;
          &lt;span class="nx"&gt;src&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://picsum.photos/800/600&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
          &lt;span class="nx"&gt;alt&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;test&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
          &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;parallax&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
          &lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{{&lt;/span&gt;
            &lt;span class="na"&gt;transform&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`translateY(&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;offset&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mf"&gt;0.5&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;px)`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="p"&gt;}}&lt;/span&gt;
        &lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;text-wrapper&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
          &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;h1&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;headline&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Parallax&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/h1&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;          &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;h2&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;sub-headline&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Scrolling&lt;/span&gt; &lt;span class="nx"&gt;effect&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/h2&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/section&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Oh man, I can understand the code. All my learning are like went into the deep sea. I cannot recall when I want to use it. Then I have the a-ha moment when see people write the code.  &lt;/p&gt;

&lt;p&gt;I think Malcolm solves it in 1 min, but I struggle for many hours. &lt;br&gt;
I need to strengthen my React fundamental. Thank you, Malcolm, I understand React a little bit more today.&lt;/p&gt;

&lt;p&gt;Check the Parallax effect in &lt;a href="https://codesandbox.io/s/parallax-effect-with-react-hooks-2k5hq?file=/src/App.js"&gt;CodeSandbox&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thank you for reading~ If you don't mind to make friend with a React Noobie. Reach me out @ Twitter&lt;/p&gt;


&lt;blockquote class="ltag__twitter-tweet"&gt;

  &lt;div class="ltag__twitter-tweet__main"&gt;
    &lt;div class="ltag__twitter-tweet__header"&gt;
      &lt;img class="ltag__twitter-tweet__profile-image" src="https://res.cloudinary.com/practicaldev/image/fetch/s--d_BUNCH4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pbs.twimg.com/profile_images/1015884789629382656/x589aq2G_normal.jpg" alt="Anson LowZF profile image"&gt;
      &lt;div class="ltag__twitter-tweet__full-name"&gt;
        Anson LowZF
      &lt;/div&gt;
      &lt;div class="ltag__twitter-tweet__username"&gt;
        &lt;a class="comment-mentioned-user" href="https://dev.to/ansonlowzf"&gt;@ansonlowzf&lt;/a&gt;

      &lt;/div&gt;
      &lt;div class="ltag__twitter-tweet__twitter-logo"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--P4t6ys1m--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/twitter-f95605061196010f91e64806688390eb1a4dbc9e913682e043eb8b1e06ca484f.svg" alt="twitter logo"&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="ltag__twitter-tweet__body"&gt;
      Rewrite the article after learning "technical writing". I want to keep on improving my writing—cheers to myself, and thanks for reading my article.&lt;br&gt;&lt;a href="https://t.co/AQbZ1J3ckZ"&gt;ansonlowzf.com/how-to-create-…&lt;/a&gt;
    &lt;/div&gt;
    &lt;div class="ltag__twitter-tweet__date"&gt;
      08:48 AM - 24 Jun 2020
    &lt;/div&gt;


    &lt;div class="ltag__twitter-tweet__actions"&gt;
      &lt;a href="https://twitter.com/intent/tweet?in_reply_to=1275712317901230080" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="/assets/twitter-reply-action.svg" alt="Twitter reply action"&gt;
      &lt;/a&gt;
      &lt;a href="https://twitter.com/intent/retweet?tweet_id=1275712317901230080" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="/assets/twitter-retweet-action.svg" alt="Twitter retweet action"&gt;
      &lt;/a&gt;
      0
      &lt;a href="https://twitter.com/intent/like?tweet_id=1275712317901230080" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="/assets/twitter-like-action.svg" alt="Twitter like action"&gt;
      &lt;/a&gt;
      0
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/blockquote&gt;


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