<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Zeeshaan Maudarbocus on Medium]]></title>
        <description><![CDATA[Stories by Zeeshaan Maudarbocus on Medium]]></description>
        <link>https://medium.com/@maudarbocus.zeeshaan?source=rss-4288f35fad73------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*NXMjzI_WCgbCoUrTBFaYtw.jpeg</url>
            <title>Stories by Zeeshaan Maudarbocus on Medium</title>
            <link>https://medium.com/@maudarbocus.zeeshaan?source=rss-4288f35fad73------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 16:33:58 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@maudarbocus.zeeshaan/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Do you even Flex…box? A visual guide to CSS Flexbox in 2019]]></title>
            <link>https://medium.com/free-code-camp/do-you-even-flex-box-c16449cfca96?source=rss-4288f35fad73------2</link>
            <guid isPermaLink="false">https://medium.com/p/c16449cfca96</guid>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[css]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[design]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Zeeshaan Maudarbocus]]></dc:creator>
            <pubDate>Tue, 30 Apr 2019 07:27:53 GMT</pubDate>
            <atom:updated>2019-05-14T19:02:23.063Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>What is CSS Flexbox?</strong></h3><p>As per the MDN web docs:</p><blockquote><em>“CSS Flexible Box Layout is a module of CSS that defines a CSS box model optimized for user interface design, and the layout of items in one dimension. In the flex layout model, the children of a flex container can be laid out in any direction, and can “flex” their sizes, either growing to fill unused space or shrinking to avoid overflowing the parent. Both horizontal and vertical alignment of the children can be easily manipulated.”</em></blockquote><p>So to summarize, it is a layout module that makes things easier to align and distribute space among items in a container.</p><p>Let’s have a quick look at a few examples of what can be done with just a minimum of 1–2 lines of codes using CSS flexbox:</p><p>Horizontal alignment layout:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*6Ag9hTafHqfGGnx4sWQX0A.png" /><figcaption>display: flex</figcaption></figure><p>Vertical alignment layout:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qucqUWwkbRPaVF0muyhN-g.png" /><figcaption>flex-direction: column</figcaption></figure><p>It’s pretty cool given that just one or two lines of CSS were required to manipulate the layout inside each container.</p><h3><strong>The Basics</strong></h3><p>Flexbox properties can be categorized into 2 main types:</p><ol><li><strong>Container properties</strong> (flex-direction, flex-wrap, justify-content, align-items, align-content)</li><li><strong>Flex Item properties</strong> (order, flex, flex-grow, flex-shrink, align-self)</li></ol><h4><strong>Display: flex</strong></h4><p>The first property is not specific to flexbox. That property is display which we set to the value: flex . This is set on the container which contains the items we want to manipulate.</p><p>Let’s add some visuals to understand how it works:</p><p>If we initially have a container, with 3 boxes ( div ) inside of it. This is how they will look like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N6zlsEvHWjTaW5rKQ6UIwg.png" /><figcaption>Container with 3 boxes</figcaption></figure><p>Now let’s add flex to the container:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p6309G0w4PG6I4FOQuJngg.png" /><figcaption>display: flex;</figcaption></figure><p>Just one line of CSS has changed the layout from a vertical direction to a horizontal one.</p><h4><strong>Important Terminologies around Flexbox</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/899/1*lEC-ubDWxZ9_p9fxr52uYA.png" /><figcaption>terminologies related to flexbox</figcaption></figure><p>These terminologies will be used throughout this guide.</p><ol><li><strong>Flex Container:</strong> This refers to the container that has display: flex; set to it.</li><li><strong>Flex Item:</strong> These are the individual children inside of the Flex Container</li><li><strong>Main-axis</strong>: By default is set from left to right.</li><li><strong>Cross-axis</strong>: By default is set from top to bottom.</li></ol><p>As soon as display: flex is set on a container, these imaginary axes are going to work together to determine how the flex items inside of the flex container should move around and behave. These two axes change directions, whenever we change certain flexbox properties which are discussed below.</p><h4><strong>Flex-direction</strong></h4><p>This property determines the direction of the imaginary axes. The axes, in turn, determines how the items in the flex container should be placed. It takes the following 4 values:</p><ol><li>row is the default value of the main axis which points from left to right. The cross-axis remains from top to bottom.</li><li>row-reverse reverses the direction of the row from right to left. Again, the cross-axis is left unaffected.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/947/1*1jyCbm18fHDE5ev92Z6yzA.png" /><figcaption>flex-direction: row-reverse;</figcaption></figure><p>3. column changes the main-axis from the horizontal axis to the vertical axis. Meaning that the main-axis is now flowing from top to bottom while the cross-axis now flows from left to right.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/978/1*MJncuUDtWtOXxArKXAXdVw.png" /><figcaption>flex-direction: column;</figcaption></figure><p>4. column-reverse is similar to the column value with the only difference being that the main-axis now flows from bottom to top.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/938/1*5iHeWHo62MNZo9WiJ512xQ.png" /><figcaption>flex-direction: column-reverse;</figcaption></figure><h4><strong>Flex-wrap</strong></h4><p>The flex-container by default does not allow for items to take up several lines in a row. Instead, all of the items will be squished to fit into one row, that is, it does not allow for wrapping into several lines.</p><ol><li>flex-wrap: no-wrap is the default.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/723/1*Lc58F9bLk6s1C-_ZjRu4ew.png" /><figcaption>no-wrap. Each block is 200px in a 500px container</figcaption></figure><p>2. flex-wrap: wrap . By changing that property to wrap, we can now ensure that each flex-item will keep their respective sizes. If they cannot fit on one line, they will wrap into a next row or column depending on the flex-direction.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/702/1*VHwCv77i332MkLgLOE0ywg.png" /><figcaption>flex-wrap set to wrap for the same case as above</figcaption></figure><p>If the flex-direction has been set to row-reverse, then the items will go onto the next row starting from the right to the left.</p><p>3. wrap-reverse on the other hand will wrap the next row of flex items above the initial one, still from left to right.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/705/1*gQmpM4raOe2mXqK6QdtVoQ.png" /><figcaption>Flex-wrap now set to wrap-reverse</figcaption></figure><h4><strong>Justify-content</strong></h4><p>This property is used very often. Its purpose is to distribute space between flex-items in a flex-container along the <strong>main axis</strong>. Its default value is set to flex-start .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p6309G0w4PG6I4FOQuJngg.png" /><figcaption>1. justify-content: flex-start;</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BTzjz3j2pMIFvr3i-s3LPg.png" /><figcaption>2. justify-content: center;</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dxBkrw3jSotyig299JkGvQ.png" /><figcaption>3. justify-content: flex-end;</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SjgUhGqKvrFhIJoK0wkuUA.png" /><figcaption>4. justify-content: space-between;</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6xQiKDgHUYTTAPOleVstEQ.png" /><figcaption>5. justify-content: space-around;</figcaption></figure><p><strong>Remember: </strong>If flex-direction has been set to column, then the main-axis would now flow from top to bottom. Meaning that justify-content would now be distributing the items in a vertical fashion.</p><h4><strong>Align-items</strong></h4><p>This property is just as popular as justify-content and is used regularly with flexbox. It does the same thing as justify-content with the only difference being that it works along the <strong>cross-axis</strong>. The default value for align-items is stretch.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t-2_Duf0WvWImUG8Qj2PCg.png" /><figcaption>1. align-items: flex-start;</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZtHkO2BQ_6MV6Ri-0Y__Lw.png" /><figcaption>2. align-items: center;</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cR1_AyumeXTn6nj5fUmOAw.png" /><figcaption>3. align-items: flex-end;</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*otR_Dljv8uBdZcTfn5bIXA.png" /><figcaption>4. align-items: baseline;</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G34ISWbpYYZUGmXt_w3dMQ.png" /><figcaption>5. align-items: stretch;</figcaption></figure><p><strong>Remember: </strong>If flex-direction has been set to column, then the cross-axis would now flow from left to right. Meaning that align-items would now be distributing the items in a horizontal fashion.</p><h4><strong>Align-content</strong></h4><p>This property is similar to and can be easily confused with align-items . The purpose of this property is to determine how space between <strong>rows</strong> in a flex-container should be distributed along the <strong>cross-axis</strong>.</p><p>While align-items targets space between flex-items, align-content targets rows between the items. The default value for align-content is stretch.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1012/1*ypERVYWxsasaNiUFlBby1Q.png" /><figcaption>1. align-content: stretch;</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1013/1*eCKs11LwlaVHIADRxp5uDA.png" /><figcaption>2. align-content: flex-start;</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1015/1*Ibxq35MYVwLpOjlEYJG5Fw.png" /><figcaption>3. align-content: center;</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1015/1*s041OIMoVKVF5TWEABuxgA.png" /><figcaption>4. align-content: flex-end;</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*fV1xXf4tl6ORJDeVCeHxkw.png" /><figcaption>5. align-content: space-between;</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1011/1*yHQPI1S9G6HOwYzNSlFmWA.png" /><figcaption>6. align-content: space-around;</figcaption></figure><h4><strong>Flex Item Properties</strong></h4><p>Time to move on to the second type of flexbox properties which allows us to target the individual items inside of a flex container.</p><h4><strong>Align-self</strong></h4><p>This property allows you to align an individual flex item along the <strong>cross-axis. </strong>It overrides the alignment set to the container through align-items.</p><p>It also takes the same properties as align-items (see above).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0aGgYDMEKvBX4EXrXsaHLg.png" /><figcaption>align-items set to flex-start on the parent container</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ERysAntaSKH9L3DplVVPhQ.png" /><figcaption>align-self set to flex-end on the orange box</figcaption></figure><h4><strong>Order</strong></h4><p>This property allows us to re-order the positions of individual flex-items inside of their flex-container. By default, all items have a value of 0 assigned to them.</p><p>By assigning a value lower (-ve) or bigger (+ve) through order on the individual items, that specific item will move to be positioned according to their values.</p><p>The order will follow the most logical convention, that is -ve, 0, +ve. The lowest number will go to the far left and the biggest number to the far right, assuming that everything else is set as default. If there are items which haven’t been assigned any new value, they remain as 0.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0KYolyvH96gLGCOCa6BegA.png" /><figcaption>default — everything has a value of 0</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fkFZrI4wKa8YbuHSW7VioQ.png" /><figcaption>setting order: -1 on box 4</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b_XWabD4r3K8vTF7Y4kXmw.png" /><figcaption>setting order: 1 on box 3</figcaption></figure><p><strong>Note: </strong>The boxes, 1, 2, 5 and 6 in the example above are all still at the default value of 0. To clarify, the six boxes above have the following values: -1, 0, 0, 0, 0, 1.</p><p>If you want to place a box in front of box number 4, then you need to set your targeted box at an order of -2 or lower.</p><h4><strong>Flex-basis, Flex-grow, and Flex-Shrink</strong></h4><p>So far, all of the flex-items were equal in size. Let’s now look at how we can make a specific flex-item take up more space inside of a flex-container as compared to the other items inside of the same container.</p><h4><strong>Flex-basis</strong></h4><p>This property specifies the <strong>ideal</strong> size of a flex item <strong>before</strong> it is placed into a flex container. It works similarly to width when working with rows. It works like height when working with columns. So if we are working with columns, and an item has been given both height and flex-basis, the flex-basis will take priority as it is the <strong>ideal</strong> height that a flex-item will take if there is enough space available.</p><p>That being said, if there is not enough space, and no height or width assigned to the items. The items will take the max-height or max-width available in the container.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WtNMgayDmoV6ZvVgQaE4cg.png" /><figcaption>width of 200px and no flex-basis set</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vDoCgcpNA3_Bcz5mC1w2hQ.png" /><figcaption>width of 200px and flex-basis of 300px. Flex-basis wins</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_S0-zmbnvDM-8SE1q801Gw.png" /><figcaption>flex-basis set to 500px. Items are smaller than 500px wide but take entire space of container</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ham_7XHQgRaxJ3Ow6FicdA.png" /><figcaption>columns, height set to 50px each, no flex-basis</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y67YgQk-3yKxaDK5MoHwQQ.png" /><figcaption>columns, height set to 50px and flex-basis set to 100px. Flex-basis wins.</figcaption></figure><h4><strong>Flex-grow</strong></h4><p>This property determines how the flex-items can grow in order to fill in the unused space in a flex-container.</p><p>If we assign a flex-grow: 1 to all boxes, they will all take the remaining space evenly which is also its default value. The number can be anything, as long as they are all the same number.</p><p>If we give flex-grow: 1 to one item and give a second one a flex-grow: 2 , then the second item will take two times as much unused space as compared to the first one.</p><p>This applies to both rows and columns.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DRbAyFWfVItEkenBVFZ0QQ.png" /><figcaption>width set to 200px, no flex-grow</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A8hUpLwirnDF2_uh4ZNWOg.png" /><figcaption>flex-grow set to 1 on the red box only</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vvoTiY-GpTJg22kP4Oy9_g.png" /><figcaption>flex-grow set to 1 on both boxes</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VQFvo4FUf8qfQllI4YCxEA.png" /><figcaption>flex-grow set to 1 on the red box and 6 on the orange box.</figcaption></figure><h4><strong>Flex-shrink</strong></h4><p>This property determines how the flex-items can shrink whenever there is <strong>not </strong>enough space in a flex-container.</p><p>The flex-shrink: 1 is the default value, meaning that all items will shrink at the same rate by default.</p><p><strong>Note: </strong><strong>flex-shrink: 0; </strong>means that this specific item should never shrink.</p><p>flex-shrink: 2; means that this specific item should shrink faster than the other ones at flex-shrink: 1;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sQSPqqtZVVcknFCfVFc7Yg.png" /><figcaption>no flex-shrink. width of items bigger than container</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ahrjKVAENJgddBNzcuyBag.png" /><figcaption>flex-shrink:2 on the red box</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b1mOzgXYL_EPkpFib7G0Qw.png" /><figcaption>flex-shrink: 4 on the red box</figcaption></figure><h4><strong>Flex</strong></h4><p>This is the shorthand version for flex-grow, flex-shrink and flex-basis in that particular order.</p><p>If you need to use all of the three above, you could simply use something like this:</p><p>flex: 0 2 200px; where 0 refers to the flex-grow, 2 refers to flex-shrink and 200px refers to flex basis respectively.</p><h3><strong>Congratulations!</strong></h3><p>That’s it! These are the key ingredients to becoming a flex master. And like for every other thing in life and in code, practice makes perfect. I highly recommend putting this guide into practice to get a practical understanding. One example could be to start with something small like a simple navigation bar.</p><p>You can also check out <a href="https://codepen.io/collection/DrwYRr/">the link to my Codepen collection on flex-box</a> which I used to create those flexboxes in the images above and tweak them to see how they change.</p><p>Thank you for reading this guide on flexbox. I hope that it was helpful and informative. If you have any questions or want to share your thoughts on this topic, please feel free to reach out through the comments section or by email at <em>maudarbocus.zeeshaan@gmail.com</em></p><p>If you found this read valuable, please show this article some love, by leaving some claps behind, so that other developers can find it too.</p><p><a href="https://github.com/ZeeshaanMaudar">ZeeshaanMaudar - Overview</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c16449cfca96" width="1" height="1" alt=""><hr><p><a href="https://medium.com/free-code-camp/do-you-even-flex-box-c16449cfca96">Do you even Flex…box? A visual guide to CSS Flexbox in 2019</a> was originally published in <a href="https://medium.com/free-code-camp">We’ve moved to freeCodeCamp.org/news</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How To Become A Self-Taught Web Developer]]></title>
            <link>https://medium.com/@maudarbocus.zeeshaan/how-to-become-a-self-taught-web-developer-96578ccc114e?source=rss-4288f35fad73------2</link>
            <guid isPermaLink="false">https://medium.com/p/96578ccc114e</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[guidelines]]></category>
            <category><![CDATA[roadmaps]]></category>
            <dc:creator><![CDATA[Zeeshaan Maudarbocus]]></dc:creator>
            <pubDate>Sun, 17 Feb 2019 19:57:36 GMT</pubDate>
            <atom:updated>2020-06-24T09:50:17.431Z</atom:updated>
            <content:encoded><![CDATA[<h3>Journey to a Junior Front-end developer role in Cape Town</h3><p>I started like most in the industry, with free resources like <a href="https://www.freecodecamp.org/">Freecodecamp<strong>,</strong></a> <a href="https://www.codecademy.com/">Codecademy</a> and Youtube. However, I soon stumbled upon <a href="https://www.udemy.com/">Udemy</a>. Such a great platform and yet I only discovered it last year. Better late than never!</p><p>I enrolled in a course called <a href="https://www.udemy.com/the-web-developer-bootcamp/">The Web Developer Bootcamp</a> by <a href="https://www.udemy.com/user/coltsteele/">Colt Steele</a>. Honestly, this is when I properly started my journey. While ‘Freecodecamp’ and ‘Codecademy’ were okay for a start, they were not sufficient for a total noob like me. Unlike with the Colt Steele online course, he assumes his students know absolutely nothing about web development. Later in the course, it moves into more advanced stuff. In the course, we eventually built a big project, called <a href="https://still-bayou-40074.herokuapp.com/">YelpCamp</a>, which makes use of both front-end and back-end technologies. (Unless he made updates, that’s how the course was when I took it). We covered ‘ME_N stack’ in this course. I would strongly recommend it to anyone who has zero to little knowledge in this field.</p><p><strong>Quick introduction to design</strong></p><p>About a month later, I was done with the front-end part of the course. I realised at that moment, that I had no sense of design at all. I could not come up with a layout that would not look like a scammy website from the early 2000s. Thanks to that acknowledgement, I enrolled into a quick course in <a href="https://www.udemy.com/learn-photoshop-web-design-profitable-freelancing/">Photoshop focused on web design</a>. The idea was not to become a designer, and for the love of everything that is good in this world, I’ll admit that I am still not a designer. But, it gave me insights about recent trends and made me understand design better. It also recommended some online resources where I could find inspirational material for designs like B<a href="https://www.behance.net/">ehance</a>.</p><p>Learning design is not a requirement, but I would definitely recommend learning some of the basics. It will come handy in the front-end developer industry. Besides, since becoming a designer was not my goal, I chose a very short course on the subject. It only took me about 1 to 2 weeks to get done with the course.</p><p>Following that, instead of resuming ‘The Web Developer Bootcamp’ course and diving into the back-end side of Javascript, I thought that I would try to build my own <a href="https://zeeshaan-maudarbocus.netlify.com/">portfolio</a> based off the skills that I have learnt so far.</p><p><strong>Building a portfolio</strong></p><p>Building <a href="https://zeeshaan-maudarbocus.netlify.com/"><strong>my own portfolio</strong></a>, a simple one page static website, took me about a week since it was my first time.. This was the first biggest learning curve in my journey. Thinking of the HTML structure, the best CSS styling that would go with it and deciding on which animations to use, how to make the experience smooth and interactive throughout the page with Javascript. These were much harder to do on my own. But when I managed to put it together, I felt like the sky was the limit. I felt confident (a bit too confident maybe).</p><p><strong>Applying for jobs</strong></p><p>Many developers around the world claim they would get a job after learning only HTML and some CSS. I had a bit of Javascript on my side and a portfolio to show off my new skills. I felt ready to become a junior web developer and started looking for a job. My expectations weren’t much at this stage, just getting anything was great for a start. After all, I could build a website.</p><p>With great positivity I started applying everywhere. I knew there was great demands for developers in Cape Town, so there must have been someone out there who would give me a shot.</p><p>Boy was I wrong. I barely got any responses. Not even one interview lined up. Nobody cared that I had put a portfolio together and that I showed some serious potential. That’s when I realised that only myself along with a few friends thought I showed potential. Web developers may be in demand in Cape Town, but that mostly applies for specific tech stacks. I soon realised that a lot of companies out there are either looking for graduates (ComSci, Engineers, Math etc) or developers who know languages like Java, C++, Asp.Net and the likes. There are a few that would take interns and juniors out of local bootcamps but most of the time, these opportunities are not highly-paid. Reality kicked in and it kicked in strong. I even considered enrolling into a bootcamp, just for the sake of getting a job or even an internship at the end.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2Fk9kKWKaUEDBM4%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fgiphy.com%2Fgifs%2Fcheezburger-loki-the-avengers-k9kKWKaUEDBM4&amp;image=https%3A%2F%2Fmedia0.giphy.com%2Fmedia%2Fk9kKWKaUEDBM4%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="244" frameborder="0" scrolling="no"><a href="https://medium.com/media/e1ba89351277f46ae4967d096c8f0c32/href">https://medium.com/media/e1ba89351277f46ae4967d096c8f0c32/href</a></iframe><p><strong>Picking myself back up</strong></p><p>It is only human to feel down for a while but I had decided I would keep on pushing and not give up. After a week, I resumed my daily routines even more rigorously. What else could I do? I’ve put in so much already and not upskilling, would only give me more time to remind myself how I’ve still not found my place as a contributing adult to society.</p><p>I continued with The Web Developer Bootcamp by diving into the back-end section for another few weeks. I learnt a bit about MongoDB, a NoSql database only to find out that MySql databases knowledge was more in demand around here. I wasn’t winning at all.</p><p>During the battle however, a friend of mine, decided it would be great to introduce me to the company he worked at. He said they were considering taking in an intern in the future for a try out.</p><p><strong>Working for free</strong></p><p>A week later, I walked into <a href="https://nona.digital/">NONA</a> over lunch time. They invited me in to have lunch with them. I told them of my journey and that I wanted a place surrounded by developers to pick up on skills that I was missing to make it as a junior developer. I asked for a place in their office to continue my courses online. They were happy with the idea that I came to them to learn more and they opened their doors for me. This is where my journey in a professional environment started.</p><p>I went in everyday and continued learning. The better part is that one of their core values is to:</p><p><em>‘Be generous with your knowledge’.</em></p><p>Everyone at NONA really embraces the core values of the company. The office turned into a library for me. They mentored me along my path to becoming a developer. It was a treasure at my disposal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*suBv0X23xNcAopvb3JgMvw.jpeg" /><figcaption>Team bonding at NONA</figcaption></figure><p>Soon after, I overheard them saying that they were going to rebuild the <a href="https://nona.digital/">NONA website</a>. They were planning to use React.js for the stack. At the time, I had no idea what React was, except for the fact that it was related to Javascript. And so, I told them that I was planning to learn React next and asked to be on the team. Who would say no to an extra helping hand, right? I was already using their space and they were paying for my Udemy courses on top of that. I thought it would be great to give back.</p><p>Besides, I would learn something new and gain real world experience for the first time. That project eventually led to a paid internship after a few months.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Ftenor.com%2Fembed%2F5653252&amp;url=https%3A%2F%2Ftenor.com%2Fview%2Fhulkvs-ironman-hulk-ironman-avengers-fighting-gif-5653252&amp;image=https%3A%2F%2Fmedia.tenor.com%2Fimages%2Fbcfc61b68104bbb194fa71ff51a3e1ef%2Fraw&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=tenor" width="600" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/df43b4e2acb1f3cf60096e88297654ac/href">https://medium.com/media/df43b4e2acb1f3cf60096e88297654ac/href</a></iframe><p><strong>Keeping myself accountable.</strong></p><p>Joining Nona made me realise how far away I was from being a full fledged developer. I still had to push, however tiring it got. On that note, I looked for people that I could relate to. People that were in the same boat as I was. I found them through social media and/or meetups. We would push each other during grind hours.</p><p>At one point, I even found a channel that was quickly gaining in popularity on YouTube by ‘The Dreaded Dev’. The channel is no more sadly, but the guy who was making those videos at the other end of the world was a huge contributor to my continuous drive at the time. He really knew how to hype learners in this field and it got me to keep pushing even harder.</p><p><strong>Join an open source community</strong></p><p>Last but not least, I joined an open-source community, called <a href="https://codebridge.org.za/">Codebridge</a>. This was one of the best decisions I made over the course of my journey.</p><p>It is a place with many developers of all levels who volunteer on projects for the sake of making Cape Town a better place. I met a senior React developer, <a href="https://medium.com/u/43fa8aff2fac">Schalk Venter</a>, at <a href="https://codebridge.org.za/">Codebridge</a> who agreed to mentor me.</p><p><strong>Making it to the beginning.</strong></p><p>A few weeks later, I approached <a href="https://medium.com/u/43fa8aff2fac">Schalk Venter</a> looking for ideas to grow my portfolio and he happened to have a project at hand for the <a href="https://codebridge.org.za/">Codebridge community</a> — <a href="https://github.com/codebridge-za/medicine-price-registry">Medicine Price Registry</a>. I agreed to take it on and started building in my free time. Little did I know, that a few months later, he would offer me my first Junior role as a Front-End Developer at a non-profit company called <a href="https://openup.org.za/">OpenUp</a>, which manages <a href="https://codebridge.org.za/">Codebridge</a>.</p><p>The journey to this offer took me a full 10 months of day and night almost non-stop commitment since the beginning of March 2018.</p><p>I’ve just started the new position last week and the impostor syndrome already kicked in heavily the week before. But I’m currently taking one step at a time, breaking down large piles of code into smaller ones and it seems to be working at the moment. For now, I’ll just take it a month at a time and hope to add as much value as possible in exchange for this amazing opportunity with <a href="https://openup.org.za/">OpenUp</a>.</p><p><strong>Advice from this journey:</strong></p><ol><li>Most people take longer than 6 months to get a decent job in this industry. It could even take up to a year or two. Do not be discouraged because of bootcamps and courses advertising that you could become one in just 3–6 months. Most of the time, they actually imply that they’ll help with internships, not actual junior roles. You need them for a foundation, but the rest depends entirely on your commitment to sticking to your path especially when the going gets tough.</li><li>Find someone or a group of people who are around the same level as you are. Code together and hold each other accountable.</li><li>Work for free for the sake of learning. Companies will most likely take you in for free and the experience you’ll gain from them, will be invaluable compared to a few months of financial sacrifice.</li><li>Find an active opensource community and offer to assist in any way that you can or attend meetups regularly. If you’re in Cape Town, come say hello at our next <a href="https://codebridge.org.za/"><strong>Codebridge community evening</strong></a>.</li><li>Find at least one mentor. They can increase the rate of your growth exponentially if you just commit to not wasting their time.</li></ol><p>To those struggling out there, I hope you relate to this story - my story. If you found it valuable, please show this article some love so that other aspiring developers can find it and can prepare better as they start their journey.</p><figure><a href="https://usejournal.com/?utm_source=medium.com&amp;utm_medium=noteworthy_blog&amp;utm_campaign=guest_post_image"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f2IVAl0TbsfES9cFGYr40g.png" /></a></figure><p>📝 Read this story later in <a href="https://usejournal.com/?utm_source=medium.com&amp;utm_medium=noteworthy_blog&amp;utm_campaign=guest_post_read_later_text">Journal</a>.</p><p>🗞 Wake up every Sunday morning to the week’s most noteworthy Tech stories, opinions, and news waiting in your inbox: <a href="https://usejournal.com/newsletter/?utm_source=medium.com&amp;utm_medium=noteworthy_blog&amp;utm_campaign=guest_post_text">Get the noteworthy newsletter &gt;</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=96578ccc114e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build a simple to-do app in React (Part 3)]]></title>
            <link>https://medium.com/developer-circles-cape-town/build-a-simple-to-do-app-in-react-part-3-27a996ee5d5d?source=rss-4288f35fad73------2</link>
            <guid isPermaLink="false">https://medium.com/p/27a996ee5d5d</guid>
            <category><![CDATA[es6]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[to-do-list]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Zeeshaan Maudarbocus]]></dc:creator>
            <pubDate>Mon, 03 Dec 2018 19:13:39 GMT</pubDate>
            <atom:updated>2019-05-05T08:12:33.911Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B34Ve8yCCLkQKz8fDCNI5Q.jpeg" /></figure><p>We’re building a simple to-do app. This is the final part of a 3-part series on how to do it. If this is your first interaction with this series you can follow on from <a href="https://medium.com/@maudarbocus.zeeshaan/build-a-simple-to-do-app-in-react-part-1-ab85ede6610b">Part 1</a> and <a href="https://medium.com/@maudarbocus.zeeshaan/build-a-simple-to-do-app-in-react-part-2-e359c20bd7d8">Part 2</a>. Just a reminder: you’ll need to have at least some familiarity with HTML5, <a href="https://medium.com/nona-web/shape-shifting-cats-intro-to-es6-3fd7cd353c1b">ES6</a>, and at least some introductory skills in <a href="https://reactjs.org/">React</a>. In this part, we will finish off our simple to-do app.</p><h3>Part 3: Add an input field to add new todos to the list.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/446/1*BkWrceo0Dqo0OfA_T2o5_Q.png" /></figure><p>The app is broken down into 3 parts:</p><p><a href="https://medium.com/@maudarbocus.zeeshaan/build-a-simple-to-do-app-in-react-part-1-ab85ede6610b"><strong>Part 1: Display a list of default todos or a message when all todos are cleared.</strong></a></p><p><a href="https://medium.com/@maudarbocus.zeeshaan/build-a-simple-to-do-app-in-react-part-2-e359c20bd7d8"><strong>Part 2: Delete an item in the list by clicking directly on it.</strong></a></p><p><a href="https://medium.com/@maudarbocus.zeeshaan/build-a-simple-to-do-app-in-react-part-3-27a996ee5d5d"><strong>Part 3: Add an input field to add new todos to the list.</strong></a></p><p>You can also move to a different part of the article if you would like to or find the completed to-do app on my <a href="https://github.com/ZeeshaanMaudar/react-todo-app">GitHub repository</a>.</p><p>Let us resume with our to-do app.</p><p><strong>Part 3: Add an input field to add new todos to the list.</strong></p><p>Now we’ll create a new component called InputForm.js which will contain our form. This component will have its own state that will be managed internally.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9721d7f71993e07220b63d2c1b39b4ca/href">https://medium.com/media/9721d7f71993e07220b63d2c1b39b4ca/href</a></iframe><p><strong>Explanation:</strong></p><p>Inside our state, we added content, the value of which is just an empty string. We will change it based off what the end-user types in the input field later. We have also created a form which contains our &lt;input&gt; tag and furthermore, we’ve dictated the type of the input field, and the placeholder for it, and assigned the value of our input field to be the content in our state.</p><p>Now, let us go back to our App.js, import our newly created InputForm.js component, and use it in our render() method.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7330a6b5af5d0b852bde922aad87a599/href">https://medium.com/media/7330a6b5af5d0b852bde922aad87a599/href</a></iframe><p><strong>Note: </strong>If we look at our app in the browser, we will notice that our input field is not responding to any changes that we type into it. This is because the value has been set to our content in our state which is just an empty string.</p><p>To make it responsive as we type in new characters in the input field, we have to go back to our InputForm.js component and add an onChange listener to the &lt;input&gt; tag.</p><p>The onChange listener will then call a function, which we can name changeValueHandler. This changeValueHandler function will, in turn, take an event as an argument.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3af4d34524ca4996e69fb3d208a37423/href">https://medium.com/media/3af4d34524ca4996e69fb3d208a37423/href</a></iframe><p><strong>Explanation:</strong></p><p>Inside our changeValueHandler function, we call setState to assign the content in our state. This should take the value of whatever is being typed in our input field in the browser. We did so by assigning it to event.target.value.</p><p>Our input field will now work correctly.</p><p><strong>Submit new todos to the list</strong></p><p>Next, we have to ensure that we can submit the form to add a new todo in our list of todos.</p><p>We can create a button in our form, and add an onClick listener to it or, we can simply call the onSubmit listener on our &lt;form&gt; tag. In this case, our onSubmit listener will call a function that we can name addValueHandler, which will again take an event as an argument..</p><p>Let us look at the code and delve into it further.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a7a66a7cce34040c09d428b98e924fe4/href">https://medium.com/media/a7a66a7cce34040c09d428b98e924fe4/href</a></iframe><p><strong>Explanation:</strong></p><p>There are 3 things that we did inside of our addValueHandler function:</p><p>Firstly, we call the preventDefault() method on our event. We do this because by default, React will refresh the page in the browser upon submitting a form through the onSubmit listener. This will lead to losing our state — which has been changed through our changeValueHandler function. We called this through our onChange listener.</p><p>Secondly, we call a newly created prop called submitValue with a parameter assigned to it. The parameter is the current state, which refers to the value that the user has typed in the input field.</p><p>Lastly, upon successful submission, we set the value of our input field back to an empty string, so that the user can type in a new todo again should he/she wishes to.</p><p><strong>Pass submitValue to InputForm</strong></p><p>Next, we head back to our App.js component, and pass this new submitValue props to our InputForm.js component there.</p><p>submitValue will in turn be assigned to a function which will get called upon submitting the form. We can name this new function addHandler.</p><p>Lastly, we have to create the addHandler function and define what it does upon execution. Remember that we have to pass in a newTodo argument to it, which refers to the parameter we set to it in InputForm.js, i.e props.submitValue(this.state).</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e6a930708f4d0afad3c94f8bf562d13f/href">https://medium.com/media/e6a930708f4d0afad3c94f8bf562d13f/href</a></iframe><p><strong>Explanation:</strong></p><p>Again, there are 3 things that we did inside of our addHandler function:</p><p>Firstly, we assigned an id to the newTodo that we received, as it only had a content type assigned to it. We use the Math.random() method which will generate a random number for us each time that a new todo is added to the list. For this scenario, Math.random() is highly unlikely to ever produce a duplicate value.</p><p>Secondly, we created a new array also named todos and we used the spread operator to clone the todos that exist in our state, in App.js. We then add our newTodo at the end of this new array. We used the spread operator here as it allows us to create a clone of our original state, immutably.</p><p>Lastly, we set the state of our App.js to take the new array we just created.</p><p>That’s it! The simple to-do app is completed.</p><p>Congratulations on building a fully functional To-Do app. I would recommend you to add your own twist to the project and some styling to make it look great.</p><p><a href="https://medium.com/@maudarbocus.zeeshaan/build-a-simple-to-do-app-in-react-part-1-ab85ede6610b"><strong>Part 1: Display a list of default todos or a message when all todos are cleared.</strong></a></p><p><a href="https://medium.com/@maudarbocus.zeeshaan/build-a-simple-to-do-app-in-react-part-2-e359c20bd7d8"><strong>Part 2: Delete an item in the list by clicking directly on it.</strong></a></p><p>You can also find the completed to-do app on my <a href="https://github.com/ZeeshaanMaudar/react-todo-app">GitHub repository</a>.</p><p>Thank you for reading part 3 of this step by step guide on how to build a to-do app in React. I hope you found it to be fruitful in some ways. Please send through your thoughts on the subject and add claps so that other developers can learn to build their own simple to-do list apps in React too.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=27a996ee5d5d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/developer-circles-cape-town/build-a-simple-to-do-app-in-react-part-3-27a996ee5d5d">Build a simple to-do app in React (Part 3)</a> was originally published in <a href="https://medium.com/developer-circles-cape-town">Developer Circles Cape Town</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build a simple to-do app in React (Part 2)]]></title>
            <link>https://medium.com/developer-circles-cape-town/build-a-simple-to-do-app-in-react-part-2-e359c20bd7d8?source=rss-4288f35fad73------2</link>
            <guid isPermaLink="false">https://medium.com/p/e359c20bd7d8</guid>
            <category><![CDATA[to-do-list]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[es6]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Zeeshaan Maudarbocus]]></dc:creator>
            <pubDate>Mon, 03 Dec 2018 19:12:24 GMT</pubDate>
            <atom:updated>2019-05-05T08:12:13.588Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B34Ve8yCCLkQKz8fDCNI5Q.jpeg" /></figure><p>Welcome to building a simple to-do app in React Part 2 — a follow on from <a href="https://medium.com/@maudarbocus.zeeshaan/build-a-simple-to-do-app-in-react-part-1-ab85ede6610b">Part 1</a>, which you can find here. Just a reminder: you’ll need to have at least some familiarity with HTML5, <a href="https://medium.com/nona-web/shape-shifting-cats-intro-to-es6-3fd7cd353c1b">ES6</a>, and at least some introductory skills in <a href="https://reactjs.org/">React</a>. In this part, we will continue our simple to-do app from where we left off.</p><h3>Part 2: Delete an item in the list by clicking directly on it.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/446/1*BkWrceo0Dqo0OfA_T2o5_Q.png" /></figure><p>The app is broken down into 3 parts:</p><p><a href="https://medium.com/@maudarbocus.zeeshaan/build-a-simple-to-do-app-in-react-part-1-ab85ede6610b"><strong>Part 1: Display a list of default todos or a message when all todos are cleared.</strong></a></p><p><a href="https://medium.com/@maudarbocus.zeeshaan/build-a-simple-to-do-app-in-react-part-2-e359c20bd7d8"><strong>Part 2: Delete an item in the list by clicking directly on it.</strong></a></p><p><a href="https://medium.com/@maudarbocus.zeeshaan/build-a-simple-to-do-app-in-react-part-3-27a996ee5d5d"><strong>Part 3: Add an input field to add new todos to the list.</strong></a></p><p>You can also move to a different part of the article if you would like to or find the completed to-do app on my <a href="https://github.com/ZeeshaanMaudar/react-todo-app">GitHub repository</a>.</p><p>Let’s continue…</p><p><strong>Part 2: Delete an item in the list by clicking directly on it.</strong></p><p>In our TodoList.js, we will add an onClick listener to the tag responsible for carrying our individual todo content.</p><p>Our onClick listener will take a callback function carrying the id of the specific object which we are targeting. Remember that we have already generated that before: todo.id</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/dd4a3bea38f70165d49c134717efb633/href">https://medium.com/media/dd4a3bea38f70165d49c134717efb633/href</a></iframe><p><strong>Explanation:</strong></p><p>Here we are saying, that on clicking the &lt;span&gt; tag, something should happen. In this case, delete, which is passed through props from App.js should be executed when our object is clicked on. This is how we execute a callback function to which we need to pass in one or more arguments (todo.id).</p><p><strong>Note: </strong>You can name the delete prop whatever you like. Just make sure, that you use the exact same name for it in App.js later.</p><p>Now, we need to add that prop to our TodoList.js component which is being rendered inside of our App.js file.</p><p><strong>What should we pass to our delete prop?</strong></p><p>We have to create another function in App.js, which will remove the targeted object for us. Let us call it deleteHandler. Remember that in this function, we have to receive the id from our TodoList.js component, which refers to todo.id. Let us see the function in code, and elaborate further afterwards.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d909c088c80d543a440e3c749f35b786/href">https://medium.com/media/d909c088c80d543a440e3c749f35b786/href</a></iframe><p><strong>Explanation:</strong></p><p>First, we created a deleteHandler function that takes in id as an argument. Then, we aim at removing the targeted object from the list. It can be done in different ways. For example, you can use the spread operator, …, to copy our list of objects, and then the splice() method to remove the targeted object or we can simply use the filter() method which will remove the targeted object from the array and return a new array. This ensures, that we are changing the state immutably.</p><p>We have used the latter method in this article. The filter() method will go through our array of objects and only return the objects whose id from our TodoList.js are <strong>not </strong>equal to the id’s from our objects in our state. Basically, we are returning objects that have not been clicked on.</p><p>We also assign the return from our filter() to a constant called todos.</p><p>Next, we set the new state of our App.js to the new constant todos we have just created, in the deleteHandler function.</p><p>Last but not least, we assign the props delete in our render() method to this.deleteHandler which is a reference to our deleteHandler function.</p><p>We can now go to our app in the browser and click on our list of todos to clear them from the browser. Should you delete all of them, a different paragraph will be rendered instead thanks to our ternary statement from Part 1 of the article.</p><p><a href="https://medium.com/@maudarbocus.zeeshaan/build-a-simple-to-do-app-in-react-part-1-ab85ede6610b"><strong>Part 1: Display a list of default todos or a message when all todos are cleared.</strong></a></p><p><a href="https://medium.com/@maudarbocus.zeeshaan/build-a-simple-to-do-app-in-react-part-3-27a996ee5d5d"><strong>Part 3: Add an input field to add new todos to the list.</strong></a></p><p>You can also find the completed to-do app on my GitHub repository <a href="https://github.com/ZeeshaanMaudar/react-todo-app">here</a>.</p><p>Thank you for reading Part 2 of this step by step guide on how to build a to-do app in React. At this point, you should be able to display a list of default todos or a message when all to-dos are cleared and<strong> </strong>delete an item in the list by clicking directly on it. If you’re stuck, message me in the comments section below and I’ll get back to you. If you’re good to move on, you can view <a href="https://medium.com/@maudarbocus.zeeshaan/build-a-simple-to-do-app-in-react-part-3-27a996ee5d5d">Part 3</a> of this series.</p><p>Please feel free to show this post some appreciation so that other developers are more likely to find it. You can also find the completed to-do app on my <a href="https://github.com/ZeeshaanMaudar/react-todo-app">GitHub repository</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e359c20bd7d8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/developer-circles-cape-town/build-a-simple-to-do-app-in-react-part-2-e359c20bd7d8">Build a simple to-do app in React (Part 2)</a> was originally published in <a href="https://medium.com/developer-circles-cape-town">Developer Circles Cape Town</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build a simple to-do app in React (Part 1)]]></title>
            <link>https://medium.com/developer-circles-cape-town/build-a-simple-to-do-app-in-react-part-1-ab85ede6610b?source=rss-4288f35fad73------2</link>
            <guid isPermaLink="false">https://medium.com/p/ab85ede6610b</guid>
            <category><![CDATA[es6]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[to-do-list]]></category>
            <dc:creator><![CDATA[Zeeshaan Maudarbocus]]></dc:creator>
            <pubDate>Mon, 03 Dec 2018 19:11:02 GMT</pubDate>
            <atom:updated>2019-05-05T08:10:51.026Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B34Ve8yCCLkQKz8fDCNI5Q.jpeg" /></figure><p>In this how-to, I’ll walk you through building a simple to-do app in React. It’s a great Javascript library for building small interfaces like this one, and a good way to get started developing and testing your skills.</p><h3>Part 1: Display a list of default todos or a message when all todos are cleared.</h3><p><strong>Prerequisite: </strong>You will need some familiarity with HTML5, ES6 and have a beginner level introductory knowledge of <a href="https://reactjs.org/">React</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/446/1*BkWrceo0Dqo0OfA_T2o5_Q.png" /></figure><p><strong>Why should you build a to-do app as an aspiring React developer?</strong></p><p>From a beginner’s perspective, I found that a to-do app is a small enough project to manage and it really helps solidify the concept of when to use props versus state throughout your app. Understanding what is going in the app while building it, will help boost your confidence moving towards bigger and more complex apps.</p><p><strong>What can you look forward to?</strong></p><p>We will make use of arrow functions ()=&gt;{}, map method map(), the filter method filter() and the spread operator ... in this exercise. These are all ES6 features. If you are not familiar with ES6, here is a great article to get you started: <a href="https://medium.com/nona-web/shape-shifting-cats-intro-to-es6-3fd7cd353c1b">Shape-Shifting Cats — Intro to ES6</a>.</p><p>We’ll break this app into 3 parts.</p><p><a href="https://medium.com/@maudarbocus.zeeshaan/build-a-simple-to-do-app-in-react-part-1-ab85ede6610b"><strong>Part 1: Display a list of default todos or a message when all todos are cleared.</strong></a></p><p><a href="https://medium.com/@maudarbocus.zeeshaan/build-a-simple-to-do-app-in-react-part-2-e359c20bd7d8"><strong>Part 2: Delete an item in the list by clicking directly on it.</strong></a></p><p><a href="https://medium.com/@maudarbocus.zeeshaan/build-a-simple-to-do-app-in-react-part-3-27a996ee5d5d"><strong>Part 3: Add an input field to add new todos to the list.</strong></a></p><p>You can also move to a different part of the article if you would like to or find the completed to-do app on my <a href="https://github.com/ZeeshaanMaudar/react-todo-app">GitHub repository</a>.</p><p><strong>Getting started</strong></p><p>Create a new project using <a href="https://github.com/facebook/create-react-app">create-react-app</a>. The first thing we are going to do is clean up the App.js file by removing unwanted content from the default project. It should look like this before starting the to-do app:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/522e452bfb60a0fb5956bdb8386c8103/href">https://medium.com/media/522e452bfb60a0fb5956bdb8386c8103/href</a></iframe><p>We will use our App.js file as the root container for our entire app.</p><p>The App.js a component is a stateful component, and hence, it requires us to import the Component Class from ‘react’ module. We can then implement the Component class in our App.js component by using the ‘extends’ keyword. This was already done for us by create-react-app.</p><p><strong>Part 1: Display a list of default todos or a message when all todos are cleared.</strong></p><p>An important thing about stateful components is that they manage states. So, in our, App.js, we will start by creating the state of the App.js component.</p><p>We add state above our render methodrender () like so:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f61bb356e2ffa93af5ca54a98b85db89/href">https://medium.com/media/f61bb356e2ffa93af5ca54a98b85db89/href</a></iframe><p><strong>Explanation:</strong></p><p>Inside our state, we have created an array called todos — which contains a list of 3 objects. Each of the 3 objects consists of an id and content key-value pair. The content of the 3 objects will be our 3 default todos upon opening the app.</p><p>We’ve also added a title for presentation purposes.</p><p><strong>Displaying our list of default todos</strong></p><p>Next, we need to loop through our list of objects to display them. We will do that by using the map() method. Let’s first create a new component called TodoList.js which will now be a functional component.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a16cf0a4ae4a53bc2fe9a12fa9bfda30/href">https://medium.com/media/a16cf0a4ae4a53bc2fe9a12fa9bfda30/href</a></iframe><p>Now we need to map through our default list of todos which is situated inside of our App.js component. To do that, we need to send it from App.js through to our child component, i.e the TodoList.js component. We do that using props .</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fd3fe34f86a93f4d2f55208fe002fbe1/href">https://medium.com/media/fd3fe34f86a93f4d2f55208fe002fbe1/href</a></iframe><p><strong>Explanation:</strong></p><p>First, we pass propsthrough as an argument to our functional component.</p><p>We then assign todos to props and map over it. Bear in mind, that we will have to use our new props in our App.js component soon.</p><p>We map through our todos and we allocate the id of our todos to the key of our wrapping tag. We’ve also created a &lt;span&gt; where we can display the content of our individual todos. To display dynamic content, we use curly brackets.</p><p><strong>Display a message when all todos are cleared</strong></p><p>Let us now add a bit of complexity to our project by adding a ternary statement that will either display our list of objects OR, if all objects have been cleared, it will display a message. This will be useful for <a href="https://medium.com/@maudarbocus.zeeshaan/build-a-simple-to-do-app-in-react-part-2-e359c20bd7d8">part 2</a> of this article.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6dcbd4a7a968e1c31c1c638b97cf3f20/href">https://medium.com/media/6dcbd4a7a968e1c31c1c638b97cf3f20/href</a></iframe><p><strong>Note: </strong>A <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Conditional_Operator">ternary statement</a> is a short alternative for using an if…else statement.</p><p>Next step is to go back to our App.js file, and import our TodoList.js component, and pass our todos props to it.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8bfffcb40817bd15a9ab2ef51d2e5286/href">https://medium.com/media/8bfffcb40817bd15a9ab2ef51d2e5286/href</a></iframe><p>We can now start our app in our terminal with <strong>npm start </strong>and we will see our list of the 3 default todos from our state being displayed in the browser.</p><p>By following these steps, you should now be able to display a list of default todos or a message when all todos are cleared.</p><p><a href="https://medium.com/@maudarbocus.zeeshaan/build-a-simple-to-do-app-in-react-part-2-e359c20bd7d8"><strong>Part 2: Delete an item in the list by clicking directly on it.</strong></a></p><p><a href="https://medium.com/@maudarbocus.zeeshaan/build-a-simple-to-do-app-in-react-part-3-27a996ee5d5d"><strong>Part 3: Add an input field to add new todos to the list.</strong></a></p><p>You can also find the completed to-do app on my <a href="https://github.com/ZeeshaanMaudar/react-todo-app">GitHub repository</a>.</p><p>Please send through your thoughts on the subject and feel free to show this post some appreciation so that other developers can find it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ab85ede6610b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/developer-circles-cape-town/build-a-simple-to-do-app-in-react-part-1-ab85ede6610b">Build a simple to-do app in React (Part 1)</a> was originally published in <a href="https://medium.com/developer-circles-cape-town">Developer Circles Cape Town</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>