<?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: Stefan Rows</title>
    <description>The latest articles on DEV Community by Stefan Rows (@stefanrows).</description>
    <link>https://dev.to/stefanrows</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%2F295783%2F0dc2532b-2746-4b07-83e4-ce84fd06e0a9.jpg</url>
      <title>DEV Community: Stefan Rows</title>
      <link>https://dev.to/stefanrows</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/stefanrows"/>
    <language>en</language>
    <item>
      <title>Streamline Your App Development with DummyAPI</title>
      <dc:creator>Stefan Rows</dc:creator>
      <pubDate>Fri, 29 Dec 2023 14:11:47 +0000</pubDate>
      <link>https://dev.to/stefanrows/streamline-your-app-development-with-dummyapi-2194</link>
      <guid>https://dev.to/stefanrows/streamline-your-app-development-with-dummyapi-2194</guid>
      <description>&lt;p&gt;Building and testing applications just got easier with DummyAPI.online! This powerful tool offers developers a wide range of mock API endpoints, perfect for simulating real-world data in your apps. Whether you're a seasoned developer or just starting, &lt;a href="https://dummyapi.online"&gt;DummyAPI.online&lt;/a&gt; is designed to speed up and simplify your development process.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is DummyAPI.online?
&lt;/h2&gt;

&lt;p&gt;DummyAPI.online provides developers with a collection of API endpoints to use as mock data for application development. It's an invaluable tool for testing, developing, and demonstrating applications without the need for setting up and maintaining a backend database.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Use DummyAPI.online?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Time-Saving: Quickly access a variety of data types and structures without the need to create them from scratch.&lt;/li&gt;
&lt;li&gt;Ease of Use: Our APIs are straightforward, allowing developers to integrate them into their projects with minimal hassle.&lt;/li&gt;
&lt;li&gt;Diverse Data Sets: Whether you need user data, posts, comments, or specific data like movies, DummyAPI.online has it all.&lt;/li&gt;
&lt;li&gt;Realistic Testing: Simulate real-world scenarios and data responses, making your app testing more robust.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How to Use DummyAPI.online
&lt;/h2&gt;

&lt;p&gt;Using DummyAPI.online is simple. Here's a quick guide to get you started:&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Visit Our Website
&lt;/h3&gt;

&lt;p&gt;Check out DummyAPI.online to explore the various endpoints available.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Browse the Documentation
&lt;/h3&gt;

&lt;p&gt;For detailed usage instructions, visit our documentation at docs.dummyapi.online. You'll find comprehensive guides and examples to help you integrate our APIs seamlessly.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: Integrate the API
&lt;/h3&gt;

&lt;p&gt;Choose the API endpoint you need and integrate it into your application. Here’s a quick example using JavaScript:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fetch('https://dummyapi.online/api/users')
  .then(response =&amp;gt; response.json())
  .then(data =&amp;gt; console.log(data));
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This fetches a list of users from our API.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 4: Test and Develop
&lt;/h3&gt;

&lt;p&gt;With the API integrated, you can start testing and developing your application with a reliable source of mock data.&lt;/p&gt;

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

&lt;p&gt;DummyAPI.online is an excellent resource for developers looking to streamline their app development and testing processes. With a wide range of mock data at your fingertips, you can focus on what you do best – creating amazing applications.&lt;/p&gt;

&lt;p&gt;Explore more at DummyAPI.online and dive into our &lt;a href="https://docs.dummyapi.online"&gt;documentation&lt;/a&gt; for detailed guides and tips.&lt;/p&gt;

&lt;p&gt;Happy coding!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Avoid Burnout as a Programmer or Hacker</title>
      <dc:creator>Stefan Rows</dc:creator>
      <pubDate>Thu, 21 Jan 2021 15:16:54 +0000</pubDate>
      <link>https://dev.to/stefanrows/avoid-burnout-as-a-programmer-or-hacker-3jia</link>
      <guid>https://dev.to/stefanrows/avoid-burnout-as-a-programmer-or-hacker-3jia</guid>
      <description>&lt;p&gt;Many of us have probably heard about &lt;strong&gt;Burnout&lt;/strong&gt; in this day and age. Maybe you even have a friend who has told you that he or she feels "&lt;strong&gt;burnt out&lt;/strong&gt;". I personally come from a hacking background and became a programmer much later, but I have seen people burning out in both of those fields left and right lately. In this article, I want to show you a few tricks how you can avoid burnout as a programmer or hacker. &lt;/p&gt;

&lt;h2&gt;
  
  
  Why do people Burn Out?
&lt;/h2&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%2Fe6tqvasibbkawhbmobxo.jpg" 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%2Fe6tqvasibbkawhbmobxo.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There is no better example to this case than the year 2020. A lot of people, while working remotely from home due to COVID, have seen the opportunity to become a Content Creator or start some other kind of side-hustle next to their full-time job. Now, if you already have a stressful full-time job and start creating content on the side, this can quickly add up and become too much. Add family and social life to the mix and you are setting yourself up for trouble. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;But why do people burn out&lt;/strong&gt;? Because they don't balance their work &amp;amp; life. I personally learned this the hard way. &lt;/p&gt;

&lt;p&gt;A typical day for most of us high achievers looks something like this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Wake up&lt;/li&gt;
&lt;li&gt;Go to work&lt;/li&gt;
&lt;li&gt;Come back home and on a good day, throw in a 30 minute workout that you hate&lt;/li&gt;
&lt;li&gt;Spend an hour or two with the family&lt;/li&gt;
&lt;li&gt;Get back on the computer and work on our content or personal projects&lt;/li&gt;
&lt;li&gt;Maybe throw in an hour of watching Netflix or TV, or maybe you are a Streamer with a regular schedule, that makes it even harder to get in enough sleep.&lt;/li&gt;
&lt;li&gt;Hit the mats directly after consuming or putting out information while staring at a screened device.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Looks familiar? Then it is time to change something.&lt;/p&gt;

&lt;p&gt;If you read through the points above, you probably see that you have zero time for self-care. I personally don't see my daily runs as self care, because I mostly end up contemplating about stuff that I still have to do in the rest of my day. &lt;/p&gt;

&lt;p&gt;Self-care is time where you slow down your mind and where you are conscious about your thoughts. Most of our days, we react unconsciously to each thought as it comes in.&lt;/p&gt;

&lt;h2&gt;
  
  
  But what should I do? I want to be successful!
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;What is success and money worth if you are unhappy?&lt;/strong&gt; For me, nothing. You can have all the money in the world and be unhappy. People always say: "Yea, but money helps with peace of mind". It doesn't, for most of us at least. &lt;/p&gt;

&lt;p&gt;The more money we accumulate, the more money we spend on sh*t we don't need, which at the same time enslaves us and ties us in deeper and deeper, raising our standard of living and making us want more and more. &lt;/p&gt;

&lt;p&gt;Once you buy a house, a car and a lot of other stuff, all this stuff needs to be maintained and comes with running cost. Every thing you buy creates a sense of false freedom and makes you "happy" only for a brief moment, while at the same time puts another bar around you, &lt;strong&gt;creating a prison that you are building around yourself&lt;/strong&gt;. You don't own your things, your things own you.&lt;/p&gt;

&lt;h2&gt;
  
  
  There is a way out, but it's not going to be easy
&lt;/h2&gt;

&lt;p&gt;It took me way too long to understand this. I ignored the signs for way too long and I paid the price in 2020. I was severely burnt out and sick to my stomach (literally). &lt;/p&gt;

&lt;p&gt;I decided to quit my well paying Job as the Head of IT of a successful startup to completely turn my life around. I decided to make my health my top priority, putting it on number one and everything else behind it. &lt;/p&gt;

&lt;p&gt;Being a certified Yoga Teacher and having a wife who is also a Yoga Teacher, I knew all the methods that are probably going to help me, I just didn't use them. I always told myself "&lt;strong&gt;there is time for that later&lt;/strong&gt;". &lt;/p&gt;

&lt;p&gt;Like most people, I only started changing things once I was affected by sickness. &lt;/p&gt;

&lt;p&gt;Now, this is not a universal solution for everyone, this is just what has helped me. &lt;strong&gt;If you can cherry-pick one or two things and implement them to your own life and it actually helps you, you can go from there&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;I believe everyone needs to find his or her own way and needs to find methods that work for them. &lt;/p&gt;

&lt;h2&gt;
  
  
  The methods that have helped me to overcome Burnout
&lt;/h2&gt;

&lt;p&gt;All of the things below are things I started including to my life once I realized I had burnout. I knew I should have done those things before getting sick, but I didn't. &lt;/p&gt;

&lt;p&gt;There is no particular order. On some days one method will help you more than the other and vice versa. The important part is, &lt;strong&gt;that you also make your health your top priority&lt;/strong&gt;. Regardless, I want to &lt;strong&gt;put an emphasize on Meditation&lt;/strong&gt;, our first point below, above everything else. &lt;strong&gt;I believe Meditation is the single most important factor to happiness&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;As long as you see your personal well-being as something secondary, it will be exactly this, something secondary that you easily skip on days where you don't feel like it.&lt;/p&gt;

&lt;p&gt;One more thing to add to that before we dive in: &lt;strong&gt;1 Minute is better than none at all&lt;/strong&gt;. Just remember this for the rest of this conversation.&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%2Fdlrambcvlhfpdaohkddr.jpg" 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%2Fdlrambcvlhfpdaohkddr.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Meditation
&lt;/h3&gt;

&lt;p&gt;Now you think "Oh yeah, here we go again", but hear me out.&lt;/p&gt;

&lt;p&gt;Meditation is the key. The key to happiness, the key to health and the key to success. Once &lt;strong&gt;YOU&lt;/strong&gt; get to be the one who decides what to do instead of your subconsciousness, you see things start changing.&lt;/p&gt;

&lt;p&gt;And believe me, I understand. &lt;strong&gt;Meditation is the single hardest thing I have ever tried to do&lt;/strong&gt;. As someone with ADHD, anxiety issues and general difficulty to concentrate on anything for longer than 5 minutes, I get it. &lt;strong&gt;It's hard&lt;/strong&gt;. It's very hard. But it's so worth it if you force yourself through the initial failures. &lt;/p&gt;

&lt;p&gt;Let me pull up a quote from &lt;strong&gt;quadruple amputee&lt;/strong&gt; Kyle Maynard on that note. (Who climbed Mount Everest and became a National Wrestling Champion)&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"I don't think failure is sometimes part of the process - it always is. When you feel you can't go on, know that you're just getting started."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Take this as your personal mantra.&lt;/p&gt;

&lt;p&gt;I personally did not take any meditation courses, I don't use apps, I don't use guided meditations. I just sit down and try to be quiet. I do mostly use some kind of meditation music or mantras (The Meditative Mind YouTube Channel has some great stuff for that).&lt;/p&gt;

&lt;p&gt;I learned a bit about meditation in my 200 Hour Yoga Teacher course, but not nearly enough that I would say that has helped me become a better meditator. The Focus in the 200 Hour Yoga Teacher training is more towards alignment, anatomy, philosophy and general teaching techniques rather than on meditation. The 300 Hour Teacher Training goes way deeper into meditation.&lt;/p&gt;

&lt;p&gt;What I can definitely say is, I definitely can feel the difference on days now where I skip my meditation practice. I am way more out of balance and it affects my whole day. When I meditate I am a better human, all around.&lt;/p&gt;

&lt;p&gt;One of the resources listed below is from one of my teachers that I had the pleasure of working with during my Yoga Teacher Training, &lt;strong&gt;Ali Choi&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;She is a very advanced meditator and is also giving Meditation Teacher Trainings. The beginner class below is donation based, so if you enjoy it make sure to either share it or let a donation come her way. &lt;strong&gt;I highly recommend checking out her content&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;There is also a great "&lt;a href="https://johnnynasello.com/product/how-to-start-meditating-8-easy-steps//ref/12887" rel="noopener noreferrer"&gt;How to Start Meditating - 8 Easy Steps&lt;/a&gt;" guide she has put together. Both of the resources come highly recommended.&lt;/p&gt;

&lt;p&gt;A couple of things for you to try:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://johnnynasello.com/product/how-to-start-meditating-8-easy-steps//ref/12887" rel="noopener noreferrer"&gt;How to Start Meditating - 8 Easy Steps&lt;/a&gt; by Ali Choi&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://johnnynasello.com/product/guided-meditation-for-beginners//ref/12887" rel="noopener noreferrer"&gt;Guided Meditation for Beginners&lt;/a&gt; by Ali Choi&lt;/li&gt;
&lt;li&gt;Sam Harris Waking Up App&lt;/li&gt;
&lt;li&gt;Calm App&lt;/li&gt;
&lt;li&gt;Headspace App&lt;/li&gt;
&lt;li&gt;Tara Brach Meditations on YouTube&lt;/li&gt;
&lt;li&gt;Meditative Mind on YouTube&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As I said, most of the time I meditate I either sit down in complete silence, or, mostly when I need to blind out external noises (Family), I use meditation music or mantras with my earphones. &lt;/p&gt;

&lt;p&gt;Listening to someone talk and guide me through something while I try to think of nothing at all, somehow defeats the purpose for me.&lt;/p&gt;

&lt;p&gt;I can't tell you how to meditate, because everyone works different. I can just share the resources that have helped me become better at it. The best time to meditate is directly after waking up. Maybe you have to join the 5AM club to find some time for quietness. Find a quiet place where you don't get interrupted or use earphones. &lt;/p&gt;

&lt;p&gt;The later it gets in the day, the higher the likeliness of you skipping your practice will be. Trust me, I speak from experience. It is also very important that you don't overdo it. Many people like to start with something like "I will meditate every day for 30 days for 10 minutes!". No, you won't. &lt;strong&gt;Start with one minute per day for one week&lt;/strong&gt;. Then do 2 minutes the next week and do this so long until you find your sweet spot. &lt;/p&gt;

&lt;p&gt;Before you know it, you'll &lt;strong&gt;look forward&lt;/strong&gt; to sitting down in quietness. &lt;/p&gt;

&lt;p&gt;You could also make it a family habit. We sit for meditation every evening before bringing our son to bed. Sometimes he can sit still for 30 seconds, sometimes he can manage a couple of minutes. We want to engrain a healthy habit into him from the get-go, and also teach him that is important to spend some time and reflect on things that had happened over the day. We already look forward to meditate together every evening now.&lt;/p&gt;

&lt;p&gt;There is a ton more I could tell you about meditation, but it would make this article way too long. After all we want to talk about more things that help you to avoid burnout as a Programmer or Hacker.&lt;/p&gt;

&lt;p&gt;In case you are also dealing with a health condition (physically or mentally), I highly recommend &lt;strong&gt;Joe Dispenza's&lt;/strong&gt; book "&lt;a href="https://amzn.to/2XuwTZT" rel="noopener noreferrer"&gt;Becoming Supernatural: How Common People are Doing the Uncommon&lt;/a&gt;". &lt;/p&gt;

&lt;p&gt;I guess you can tell how important and how much weight I put on meditation after reading this section. Let's move on.&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%2Fg5ygzpyxh0u0ihr5sbo0.jpg" 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%2Fg5ygzpyxh0u0ihr5sbo0.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Yoga
&lt;/h3&gt;

&lt;p&gt;Of course, I have to mention Yoga. Yoga for me is everything. Before attending my first Yoga class I had the same false expectation like most people I know who haven't tried it: "&lt;strong&gt;Yoga is a Women's thing and it is boring&lt;/strong&gt;". &lt;/p&gt;

&lt;p&gt;All of them quickly changed their mind after visiting an actual class, &lt;strong&gt;including me&lt;/strong&gt;. Also, &lt;a href="https://www.youtube.com/watch?v=xieJTGj7hss" rel="noopener noreferrer"&gt;this Video&lt;/a&gt; by a fellow Yoga Teacher, &lt;em&gt;Dylan Werner&lt;/em&gt;, might convince you otherwise.&lt;/p&gt;

&lt;p&gt;Now there is a gazillion ways of getting into Yoga, the one I recommend would be &lt;strong&gt;joining a beginner class&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;A lot of people nowadays start with Online Yoga. The problem with this is, &lt;strong&gt;there is nobody to correct you in your poses, which eventually will lead to you learning things the wrong way&lt;/strong&gt;, ending up hurting yourself while trying to do something good for yourself.&lt;/p&gt;

&lt;p&gt;Also, unlearning something that was wrongly learned is very, very hard. &lt;/p&gt;

&lt;p&gt;But I know, most of you will be like: "But everyone will laugh at me". No, no one will laugh at you. The Yoga community, for the most part, is very friendly and welcoming to beginners. Everyone more advanced knows how hard it is to start.&lt;/p&gt;

&lt;p&gt;If you don't want that, I understand. If you must start online, there are a couple of channels I recommend you checking out, which are beginner friendly and very popular.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.youtube.com/user/yogawithadriene" rel="noopener noreferrer"&gt;Yoga with Adriene&lt;/a&gt; (Very beginner friendly and very popular)&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/user/lesleyfightmaster" rel="noopener noreferrer"&gt;Fightmaster Yoga&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;My own channel, &lt;a href="https://www.youtube.com/channel/UCDbYvP6yTSVTzaAF7GuSLjA" rel="noopener noreferrer"&gt;Stefan Rows Yoga&lt;/a&gt; (I am just starting out, so more content will come over time, make sure to subscribe for that)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Another option, "thanks" to Covid is, simply attending an online class of a local studio using Zoom. That way, if you get a good instructor, they are able to direct you via video. Almost all studios offer Online Classes at this moment, so this is a good option.&lt;/p&gt;

&lt;p&gt;Look out for classes labeled as "beginner" or "introduction". &lt;/p&gt;

&lt;p&gt;There is also the option to book a private class with me and I will tailor a program according to your abilities. Just shoot me an email to &lt;strong&gt;&lt;a href="mailto:stefanrows@gmail.com"&gt;stefanrows@gmail.com&lt;/a&gt;&lt;/strong&gt; to book a slot with me.&lt;/p&gt;

&lt;p&gt;For the most part, Yoga nowadays is used as a tool to stay in shape. There are a lot of different styles of Yoga, yet there is just one Yoga. I wont bore you with the philosophy, but for me personally, Yoga is much more than that. &lt;/p&gt;

&lt;p&gt;I use Yoga to tune it with my body and prepare myself for my meditation practice. Practicing Asanas (Yoga poses) helps me to get in the zone and focus on what's to come.&lt;/p&gt;

&lt;p&gt;I also use Yoga as a tool to listen to my body, my body tells me when something needs more attention and I always try to follow that calling. I am a firm believer that Yoga is a tool to cure many diseases without the need of medication or surgery.&lt;/p&gt;

&lt;p&gt;I highly recommend the book "&lt;a href="https://amzn.to/39ob2bX" rel="noopener noreferrer"&gt;Light on Yoga&lt;/a&gt;" by B.K.S Iyengar for anyone dealing with health issues.&lt;/p&gt;

&lt;h3&gt;
  
  
  Breathwork
&lt;/h3&gt;

&lt;p&gt;My first profound experience with breathwork was through the Wim Hof Method (See next point). After using his breathing method for the first time, I already knew I am onto something. At this moment, I had no prior contact with Pranayama (The Yogic breathing technique), but I knew I had to dig deeper, and deeper I dug. &lt;/p&gt;

&lt;p&gt;I found the excellent book "&lt;strong&gt;&lt;a href="https://amzn.to/3oFtzHf" rel="noopener noreferrer"&gt;Breath&lt;/a&gt;&lt;/strong&gt;" by James Nestor. James is a researcher who had struggled with breathing problems his whole life. He made it his mission to discovering everything there is to know about breathing. The book really is fantastic, I loved reading it and have already read it 3 times and gifted it numerous times to friends who struggle with health.&lt;/p&gt;

&lt;p&gt;It became apparent to me that breathing is the key to many health related issues. If you implement a regular breathing practice to your daily routine, you will see a quick overall shift in your mood. You can literally breath depression away. Same as with meditation, this is not easy to learn and requires discipline. &lt;/p&gt;

&lt;p&gt;Simply sitting down and just breathing sounds easy, but try doing it for prolonged periods of time - as with everything else, &lt;strong&gt;we lose interest if we do not see quick results&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;There is only one resource I can share with you &lt;strong&gt;because it is the best resource I know&lt;/strong&gt;. It's a full-on 5 week Pranayama Course that was made by my own Yoga Teacher, Johnny Nasello. &lt;/p&gt;

&lt;p&gt;I have had many Yoga Teachers throughout the years, but after taking one of his classes I immediately knew that this would be my teacher. I took his 200 Hour Yoga Teacher Training back in 2019 in Koh Phangan, Thailand. &lt;/p&gt;

&lt;p&gt;Johnny has spent a month in India practicing nothing else than Pranayama (Breathing). So you can be sure that everything he teaches comes from a deep understanding of Pranayama. He has led more than 20 Yoga Teacher trainings and has thousands of hours of experience with Yoga.&lt;/p&gt;

&lt;p&gt;There is a free intro to the course called "&lt;a href="https://johnnynasello.com/product/breath-of-yoga//ref/12887" rel="noopener noreferrer"&gt;&lt;strong&gt;The Breath of Yoga&lt;/strong&gt;&lt;/a&gt;" which helps to get you started with the basics. If you feel like you need more, you can take on the full 5-Week experience "&lt;a href="https://johnnynasello.com/product/learn-pranayama-online-course//ref/12887" rel="noopener noreferrer"&gt;&lt;strong&gt;Learn Pranayama Online&lt;/strong&gt;&lt;/a&gt;". I took the course and I loved it.&lt;/p&gt;

&lt;p&gt;Again, if you feel lost, don't hesitate to book a consultation with me at &lt;a href="mailto:stefanrows@gmail.com"&gt;stefanrows@gmail.com&lt;/a&gt; and we figure a path out for you together.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Wim Hof Method
&lt;/h3&gt;

&lt;p&gt;Ah, now the fun begins, cold water! Everyone loves cold water, right? With cold, I mean ice cold. No, seriously. I practice Wim Hof's breathing method and cold water exposure since around 2015 on and off. &lt;/p&gt;

&lt;p&gt;I go to swim in frozen lakes in the midst of Winter and I love it. It makes you feel alive and it feels absolutely great when you've done it. There is a lot of science around Wim Hof's method, the best thing you could do is grab his newly released book "&lt;a href="https://amzn.to/3oAued5" rel="noopener noreferrer"&gt;Activate Your Full Human Potential&lt;/a&gt;" from 2020 and see for yourself.&lt;/p&gt;

&lt;p&gt;There is a lot of evidence that this method can heal serious depression and illness, it certainly was life changing for me. The same goes for cold water exposure in general.&lt;/p&gt;

&lt;p&gt;The best you can do is join a local Wim Hof Method Workshop near you, they happen around the world regularly now. Or simply check out this &lt;a href="https://www.youtube.com/watch?v=Y1ial3Rc7Xg" rel="noopener noreferrer"&gt;introduction video&lt;/a&gt; from Wim himself.&lt;/p&gt;

&lt;h3&gt;
  
  
  Therapy
&lt;/h3&gt;

&lt;p&gt;I really hope that in this day and age we are past the stigma that was attached to psychological therapy. In the past it was frowned upon if you admitted you have mental problems. &lt;/p&gt;

&lt;p&gt;In this fast pace worlds, but especially in our fast paced jobs where our brain is under overload the majority of our waking hours, it comes as no surprise that we develop mental health problems.&lt;/p&gt;

&lt;p&gt;Do I need to mention the bombardment of information we get every day through our Smartphones? &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Just know this:&lt;/strong&gt; The human mind is not used of consuming this insane amount of information on a daily basis, the result for most of us is: we burn out and feel overwhelmed. &lt;/p&gt;

&lt;p&gt;Unfortunately this also cultivates mental illness. You may not consciously realize it, but watching other people's seemingly "perfect life" (&lt;a href="https://www.dazeddigital.com/life-culture/article/50575/1/instagram-influencers-are-posing-in-fake-private-jets-were-questioning-reality" rel="noopener noreferrer"&gt;which is mostly fake by the wa&lt;/a&gt;y) makes you compare your own life, even on a subconscious level, to those people, which is not exactly healthy. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;I see taking therapy no different than going to the doctor because you have a cough&lt;/strong&gt;. You are ill, you go to the doctor. Simple as that.&lt;/p&gt;

&lt;p&gt;My recommendation is, &lt;strong&gt;find a therapist as soon as you have the feeling something is not right&lt;/strong&gt;. If you feel sad, tired or a general lack of motivation, it is the time to talk to someone. &lt;/p&gt;

&lt;p&gt;The longer you let those negative feelings linger without taking action, the harder you will have it to get back on track. &lt;/p&gt;

&lt;p&gt;Referencing &lt;strong&gt;&lt;a href="https://amzn.to/2XuwTZT" rel="noopener noreferrer"&gt;Joe Dispenza's book&lt;/a&gt;&lt;/strong&gt; I had mentioned earlier, you can literally conjure up diseases entirely with your own mind. (Gladly you can make them go away again too using the right techniques).&lt;/p&gt;

&lt;p&gt;In the best case the therapist will tell you you don't need therapy and recommends you something to do instead. Or you get treated early and will be over it in no time. &lt;/p&gt;

&lt;p&gt;If you take away anything from this whole article let it be this: &lt;strong&gt;don't be afraid to ask for help&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F0x1lumma8g5mnk5v481c.jpg" 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%2F0x1lumma8g5mnk5v481c.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Journaling
&lt;/h3&gt;

&lt;p&gt;Journaling is one of those things that could really help you to avoid burnout as a programmer or hacker. It certainly did a great deal for me. &lt;/p&gt;

&lt;p&gt;Let's just say, the year 2020 hasn't been the best for me and leave it at that. In one of the darkest moments, I picked up journaling. I remember reading about it in one of the numerous self-help books I have read throughout the years. &lt;/p&gt;

&lt;p&gt;I said from this moment on, every time I will feel sad or unhappy, I put some thoughts down in my journal. I quickly realized that every time I picked up the pen and wrote out my thoughts, things started shifting for me. I realized that some of the thoughts I had were absolute irrational and bullshit when I brought them to life. &lt;/p&gt;

&lt;p&gt;I made it a habit to pick up the pen every time I feel off and write out the shit that was going on. It helped. &lt;/p&gt;

&lt;p&gt;I moved on from doing that to write a journal at the end of every day. Now there are people who like to journal first thing in the morning (same as with meditating), while I get why they do it, it isn't for me. &lt;/p&gt;

&lt;p&gt;You have to figure out what works for you in that case. For me, struggling with sleep since a couple of years, it is better to write out my thoughts before hitting the mats. This helps me to reflect on my day and it also helps me to get those thoughts out of my head.&lt;/p&gt;

&lt;p&gt;I certainly feel there is some benefit to that and I have a better nights sleep every time I do journal (which is almost every day now). &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;I can't give you a ton of advice other than&lt;/strong&gt;: &lt;a href="https://amzn.to/3sjnItE" rel="noopener noreferrer"&gt;Buy a cheap notebook&lt;/a&gt;, start to write out your thoughts and see what happens.&lt;/p&gt;

&lt;h3&gt;
  
  
  Physical Activity / Sport
&lt;/h3&gt;

&lt;p&gt;Now, you have probably heard this before but if it isn't obvious yet, &lt;strong&gt;we are not made to sit&lt;/strong&gt;. Most of us sit, most of the time. We are made to move. If we stop moving our meat-vehicle around on a daily basis, we start dying. It literally translates to: You stop moving - you start dying. &lt;/p&gt;

&lt;p&gt;Also, sitting around the whole day and not giving our body the movement it needs makes you depressed. This has been proven in numerous studies (which I am far too lazy to include here). &lt;/p&gt;

&lt;p&gt;Moving makes you happy! Being outside on the fresh air makes you even happier!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Every single time I don't want to go for a run&lt;/strong&gt; but convince myself otherwise, &lt;strong&gt;I feel better afterwards&lt;/strong&gt;. The same goes for other sports. I mostly don't like to do any sport unless I convince myself that I will feel better afterwards, and I always do.&lt;/p&gt;

&lt;p&gt;As I have mentioned above, running does not help me to mentally shut off. It's just not hard enough for me. &lt;/p&gt;

&lt;p&gt;What I have found is, and I am sure some of you will belong to this category (&lt;strong&gt;If not you have to try it!&lt;/strong&gt;), is that very physically draining sports or activities help me to shut off my brain for a brief moment. &lt;/p&gt;

&lt;p&gt;I have learned this when I was practicing Brazilian Jiu-Jitsu 5-6 times a week when I was living in Prague, Czechia. At the end of every class we would do sparring for 3 or 4 eight minute rounds. This is full contact ground fighting. &lt;/p&gt;

&lt;p&gt;There is honestly nothing I have ever tried that depleted me more physically than trying to survive against a shark on the floor for 3x8 minutes straight. I sometimes had to vomit after class ( I was not the only one). &lt;/p&gt;

&lt;p&gt;But what I have learned from that experience, and that was probably part of why I liked it so much was, within those 8 minutes of struggle, my brain did not work as usually. There was no time for thoughts, there was only time for reaction. Automatic muscle memory. A state of complete nothingness and flow. &lt;/p&gt;

&lt;p&gt;This was probably my first contact with "meditation". It worked for me. I also recognized how much it was missing in my life when I had to stop training due to moving to another country and starting a family. I was angrier, imbalanced and just generally missing something.&lt;/p&gt;

&lt;p&gt;I just realized much later that what was missing was probably not the physical combat part, but the quiet time for my brain in those 8 minutes of full contact sparring. &lt;/p&gt;

&lt;p&gt;I had similar experiences in other sports like Crossfit, but never to an extend as in BJJ. &lt;/p&gt;

&lt;p&gt;Long story short, give something hard a try. Try something that is completely depleting you and doesn't allow you to think. A couple of things I'd recommend are listed below. &lt;strong&gt;If you have any health conditions or are completely new to sport, I don't recommend doing any of those&lt;/strong&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Brazilian Jiu-Jitsu&lt;/li&gt;
&lt;li&gt;Muay Thai&lt;/li&gt;
&lt;li&gt;Boxing&lt;/li&gt;
&lt;li&gt;Crossfit&lt;/li&gt;
&lt;li&gt;Kettlebell Training&lt;/li&gt;
&lt;li&gt;High Intensity Workouts (HIIT)&lt;/li&gt;
&lt;li&gt;High Intensity Cycling&lt;/li&gt;
&lt;li&gt;Sprints&lt;/li&gt;
&lt;li&gt;Insert any completely exhausting sport here...&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Sleep
&lt;/h3&gt;

&lt;p&gt;Oh sleep. I hope by now everyone understands how important sleep is. I won't get into a lot of sleep science, but I read a lot of books on sleep so I can share what I have learned. I can highly recommend the book "&lt;strong&gt;&lt;a href="https://amzn.to/2MMuLdO" rel="noopener noreferrer"&gt;Why We Sleep&lt;/a&gt;&lt;/strong&gt;"  by Matthew Walker PhD. By far the best book I have read on sleep and by far the one with the biggest influence on my sleep.&lt;/p&gt;

&lt;p&gt;I have struggled with sleep my whole adulthood. I now have it under control thanks to the daily rituals and practices I implemented in my life. &lt;/p&gt;

&lt;p&gt;I really do not want to bore you with a ton of science, because there is so much, I rather give you a couple of key points that have improved my sleep the most. I talk from years of experience and trying literally everything there is, including a pricy 3-Nights stay in a sleep laboratory. &lt;/p&gt;

&lt;p&gt;I try to give this somewhat of an order to make clear what helped me the most, but don't think it has to be the same for you, it can be any of those things.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Proper Sleep Hygiene (No screens 1h before bed, go to bed at the same time every day, do your sleep ritual before going to bed, which can be any of the above mentioned methods)&lt;/li&gt;
&lt;li&gt;Meditation and Breathwork before bed&lt;/li&gt;
&lt;li&gt;A &lt;a href="https://amzn.to/35yNMXE" rel="noopener noreferrer"&gt;weighted blanked&lt;/a&gt; (this seriously had the biggest influence on my sleep that I can remember, it's also scientifically proven to work). Do your own research on quality / brand. I live in Germany so I can't tell what is good in the US. I use the Gravity Blanket.&lt;/li&gt;
&lt;li&gt;CBD Oil 10%+ (Expensive but it works)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://amzn.to/3si1sQP" rel="noopener noreferrer"&gt;L-Tryptophan&lt;/a&gt; (I can't recall where I came on this, but this also helps to relax you before sleep, it works for me, especially in combination with the CBD Oil)&lt;/li&gt;
&lt;li&gt;Earplugs (I generally sleep with Earplugs and have had lots of success with getting better sleep, because I have a kid at home and generally wake up from every fly's fart)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://join.whoop.com/#/F2AF4F" rel="noopener noreferrer"&gt;Whoop Strap&lt;/a&gt; (I use a Whoop strap to measure and optimize my sleep, while not directly improving my sleep by itself, it definitely helps you to find out what works and what doesn't. It was a very worthwhile investment for me)&lt;/li&gt;
&lt;li&gt;Reduce caffeine intake (Caffeine has a &lt;a href="https://www.healthline.com/health/how-long-does-caffeine-last#how-long-symptoms-last" rel="noopener noreferrer"&gt;half-life time of 3-5 hours&lt;/a&gt;, let's assume you consume a Monster Energy drink which has 36mg caffeine at 3PM. That leaves you with an astonishing 18mg of caffeine at 8PM and still with the half of that 5 hours later. If you are sensitive to caffeine like me, this messes up your sleep big time)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I think those were the most important factors to improving sleep. See what works for you.&lt;/p&gt;

&lt;h3&gt;
  
  
  Diet
&lt;/h3&gt;

&lt;p&gt;Now, I won't go into the topic of diet very deep, and I certainly wont tell you what to eat but just know this: &lt;strong&gt;you are what you eat&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;If you stuff yourself with sh*t the whole day, you will feel like sh*t. I won't say which diet is the best, because that highly differs from person to person, there is no one fit all. I personally follow a mostly vegetarian diet with as little processed foods as I can. &lt;/p&gt;

&lt;p&gt;On most days I eat 90% unprocessed foods and 10% processed. Sometimes less. I try to avoid sugar and any kind of stimulants like caffeine or alcohol. Of course, there are exceptions but I generally try to avoid those.&lt;/p&gt;

&lt;p&gt;There is too much to say about diet. If you take one thing away from this: the least processed the better. Stick to natural foods and if you can afford it, go all organic. I have tried almost every popular diet over longer periods of time (1 month to several years), and I have found that sticking with the simple principle of "&lt;strong&gt;least processed, lots of different veggies&lt;/strong&gt;" works best for me.&lt;/p&gt;

&lt;p&gt;There is an excellent book by &lt;strong&gt;Paul Chek&lt;/strong&gt;, whom I deeply respect. It's called "&lt;a href="https://amzn.to/3bvREfQ" rel="noopener noreferrer"&gt;How to Eat, Move and Be Healthy&lt;/a&gt;". If you have no clue how to start your diet journey, buy this book.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;One last tip&lt;/strong&gt;: Don't follow any fad diets or any "loose fat quickly" diets. They &lt;strong&gt;never&lt;/strong&gt; work and are not sustainable, nor healthy.&lt;/p&gt;

&lt;h2&gt;
  
  
  Help with Building Habits
&lt;/h2&gt;

&lt;p&gt;Building sustainable habits is &lt;strong&gt;very hard&lt;/strong&gt;. Gladly, there is a great book about that. In fact, it's one of my all-time favorite books. "&lt;a href="https://amzn.to/3i64l28" rel="noopener noreferrer"&gt;Atomic Habits&lt;/a&gt;" by James Clear. &lt;/p&gt;

&lt;p&gt;James tells you his own incredible story and how he turned his life around after having an (near-death) accident. I seriously haven't found better advice on building habits in any other resource I have studied. &lt;/p&gt;

&lt;p&gt;James makes it so easy for you to implement new habits. Here is a little &lt;a href="https://jamesclear.com/how-to-stop-procrastinating" rel="noopener noreferrer"&gt;bite-sized piece of his work&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;I have gifted this book to numerous friends and all of them loved it. It is definitely worth checking out on your journey to avoid burnout as Programmer or Hacker, because all stands and falls with the building of a habit.&lt;/p&gt;

&lt;h2&gt;
  
  
  A Note on Discipline
&lt;/h2&gt;

&lt;p&gt;I want to emphasize that not a single one of those techniques will give you quick success. I know how we work, we want it all and we want it now. But this is not how this works. &lt;/p&gt;

&lt;p&gt;Everything mentioned above needs time. It needs time to cultivate. You can't reverse 20 years of bad habits or a long history of bad health with a week of Yoga. You need to understand this, I did not understand it from the beginning and I was very frustrated at some point, until I started accepting that those things need time and that is ok.&lt;/p&gt;

&lt;p&gt;I encourage you to start with small steps. As everything in life, consistency is key. &lt;/p&gt;

&lt;p&gt;Start small, start with a minute a day and slowly pick up the pace until you find your sweet spot. If you set too ambitious goals with those things, the only thing that will happen is that you give up and bounce back to a worse state than before. (Diets, anyone?)&lt;/p&gt;

&lt;p&gt;You got this. I believe in you. &lt;/p&gt;

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

&lt;p&gt;While I feel like I could go on forever on that topic, I have to wrap up this article to not make it too long and too complicated. There is so much advice I can give about how to Avoid Burnout as a Programmer or Hacker that I could write a small book about it. &lt;/p&gt;

&lt;p&gt;I believe in allocating a certain amount of time every single day to your self-care routine. If that means you have to join the 5AM club, so be it, but do it! For me it's the opposite, I stay up late until everyone sleeps to do my routine in quietness. I dedicate two to three full hours to self-care every single day. Which on most days is like 2 hours for Yoga, Meditation and Breathwork and around 1 hour for sport.&lt;/p&gt;

&lt;p&gt;I am very involved in the Twitter InfoSec and Programming community and I see posts about people burning out on a daily basis. Going through all of this myself, I want to help people. The people in this community usually earn a solid salary, so they should be able to get the help they deserve to continue being the best at their job.&lt;/p&gt;

&lt;p&gt;If you feel overwhelmed by all of this or you feel like you can't deal with it alone, &lt;strong&gt;you can book a one-to-one online session with me by writing me an email to &lt;a href="mailto:stefanrows@gmail.com"&gt;stefanrows@gmail.com&lt;/a&gt;&lt;/strong&gt; and we can tailor an individual plan that fits to your lifestyle. &lt;/p&gt;

&lt;p&gt;I hope this article helps you to find direction. Take it easy and stay healthy!&lt;/p&gt;

&lt;h2&gt;
  
  
  Resources Mentioned in this Article
&lt;/h2&gt;

&lt;p&gt;(Includes affiliate links)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Books&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://amzn.to/2XuwTZT" rel="noopener noreferrer"&gt;Becoming Supernatural: How Common People are Doing the Uncommon&lt;/a&gt; - Joe Dispenza&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://amzn.to/39ob2bX" rel="noopener noreferrer"&gt;Light on Yoga&lt;/a&gt; - B.K.S Iyengar&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://amzn.to/2MMuLdO" rel="noopener noreferrer"&gt;Why We Sleep&lt;/a&gt; &lt;strong&gt;-&lt;/strong&gt; Matthew Walker PhD&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://amzn.to/3oAued5" rel="noopener noreferrer"&gt;Activate Your Full Human Potential&lt;/a&gt; - Wim Hof&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://amzn.to/3i64l28" rel="noopener noreferrer"&gt;Atomic Habits&lt;/a&gt; - James Clear&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://amzn.to/3oFtzHf" rel="noopener noreferrer"&gt;Breath&lt;/a&gt; - James Nestor&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://amzn.to/3bvREfQ" rel="noopener noreferrer"&gt;How to Eat, Move and Be Healthy&lt;/a&gt; - Paul Chek&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Apps&lt;/strong&gt;: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sam Harris Waking Up App&lt;/li&gt;
&lt;li&gt;Calm App&lt;/li&gt;
&lt;li&gt;Headspace App&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Channels&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Tara Brach Meditations on YouTube&lt;/li&gt;
&lt;li&gt;Meditative Mind on YouTube&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.youtube.com/user/yogawithadriene" rel="noopener noreferrer"&gt;Yoga with Adriene&lt;/a&gt; (Very beginner friendly and very popular)&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/user/lesleyfightmaster" rel="noopener noreferrer"&gt;Fightmaster Yoga&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/channel/UCDbYvP6yTSVTzaAF7GuSLjA" rel="noopener noreferrer"&gt;Stefan Rows Yoga&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Devices&lt;/strong&gt;: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://join.whoop.com/en-eu/F2AF4F" rel="noopener noreferrer"&gt;Whoop Strap&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Courses&lt;/strong&gt;: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://johnnynasello.com/product/how-to-start-meditating-8-easy-steps//ref/12887" rel="noopener noreferrer"&gt;How to Start Meditating - 8 Easy Steps&lt;/a&gt; by Ali Choi&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://johnnynasello.com/product/guided-meditation-for-beginners//ref/12887" rel="noopener noreferrer"&gt;Guided Meditation for Beginners&lt;/a&gt; by Ali Choi&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;One-to-One's&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Private Yoga Classes → &lt;a href="mailto:stefanrows@gmail.com"&gt;stefanrows@gmail.com&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Consultation / Personal Plans → &lt;a href="mailto:stefanrows@gmail.com"&gt;stefanrows@gmail.com&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>mentalhealth</category>
      <category>burnout</category>
      <category>programming</category>
      <category>hacking</category>
    </item>
    <item>
      <title>Create reusable Components in React with Styled Components</title>
      <dc:creator>Stefan Rows</dc:creator>
      <pubDate>Thu, 07 Jan 2021 20:00:01 +0000</pubDate>
      <link>https://dev.to/stefanrows/create-reusable-components-in-react-with-styled-components-52k1</link>
      <guid>https://dev.to/stefanrows/create-reusable-components-in-react-with-styled-components-52k1</guid>
      <description>&lt;p&gt;I recently started using Styled Components when developing in React. There is a huge advantage in using Styled Components, it allows you to create re-usable components within just one .jsx file. &lt;/p&gt;

&lt;p&gt;When playing around with Styled Components, I quickly realized how easily I can re-use some of my components. So, what I normally do is, I create a Repository called something like: react-components. Here I will simply store all of the components that I have created for a client or for a project for later use.&lt;/p&gt;

&lt;p&gt;Why throw away something that looks nice when you easily can export the whole thing within just one file?&lt;/p&gt;

&lt;p&gt;I'll quickly run you through the process I use. For this example we will use a simple, freshly created React App.&lt;/p&gt;

&lt;h2&gt;
  
  
  Creating a new React App
&lt;/h2&gt;

&lt;p&gt;Obviously you can skip this step if you don't want to follow along and you just want to know how to create a re-usable component.&lt;/p&gt;

&lt;p&gt;I went ahead and created a new folder in my WSL2 Ubuntu 20.04 installation called &lt;strong&gt;reusable-button-component&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Then I &lt;strong&gt;CD&lt;/strong&gt; into it and run &lt;strong&gt;create-react-app&lt;/strong&gt; to create a new app inside of this folder. Then I open &lt;strong&gt;VSCode&lt;/strong&gt; from within the folder.&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;mkdir &lt;/span&gt;reusable-button-component
&lt;span class="nb"&gt;cd &lt;/span&gt;reusable-button-component
npx create-react-app &lt;span class="nb"&gt;.&lt;/span&gt;
code &lt;span class="nb"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Basic stuff, which you should know when you ended up here.&lt;/p&gt;

&lt;p&gt;Then I just launch the app with &lt;strong&gt;npm start&lt;/strong&gt;. If you follow along you should see something like this now:&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%2Ft44wnq23q8yd8nw3jtli.jpg" 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%2Ft44wnq23q8yd8nw3jtli.jpg" alt="Styled Components"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing Styled Components
&lt;/h2&gt;

&lt;p&gt;Now we need to go ahead and also install styled-components. To do that, simply type:&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;styled-components &lt;span class="nt"&gt;--save&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;strong&gt;—save&lt;/strong&gt; at the end is optional, in case you want to include styled-components to your package.json file.&lt;/p&gt;

&lt;p&gt;Don't forget to run &lt;strong&gt;npm audit fix&lt;/strong&gt; in case some vulnerabilities are detected.&lt;/p&gt;

&lt;h2&gt;
  
  
  Creating Folders &amp;amp; The Button Component
&lt;/h2&gt;

&lt;p&gt;Now that we have that in check, we can go ahead and create our &lt;strong&gt;components&lt;/strong&gt; folder inside of the &lt;strong&gt;src&lt;/strong&gt; folder.&lt;/p&gt;

&lt;p&gt;Inside of the &lt;strong&gt;components&lt;/strong&gt; folder, we create a &lt;strong&gt;Buttons&lt;/strong&gt; folder.&lt;/p&gt;

&lt;p&gt;Inside of the Buttons folder we create a file called &lt;strong&gt;TestButton.jsx&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Your folder structure should now look something like this:&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%2Fk31c3n7dqv322zmtoiwt.jpg" 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%2Fk31c3n7dqv322zmtoiwt.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Creating the Button Component
&lt;/h2&gt;

&lt;p&gt;Alright, time to create our button. We will do something very simple to not overcomplicate things.&lt;/p&gt;

&lt;p&gt;First we need some React boilerplate:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&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="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;TestButton&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="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;

        &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="s2"&gt;```

``

You should be familiar with this.

Next up we need to import styled-components:

``

```&lt;/span&gt;&lt;span class="nx"&gt;jsx&lt;/span&gt;
&lt;span class="k"&gt;import&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="s1"&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="nx"&gt;styled&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;styled-components&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;TestButton&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="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;

        &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="s2"&gt;```

``
Good. Our foundation is set!

Next up, we create a Styled Component called Button (or whatever you like) and apply some simple styling to it.

``

```&lt;/span&gt;&lt;span class="nx"&gt;jsx&lt;/span&gt;
&lt;span class="k"&gt;import&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="s1"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;styled&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;styled-components&lt;/span&gt;&lt;span class="dl"&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;Button&lt;/span&gt; &lt;span class="o"&gt;=&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;button&lt;/span&gt;&lt;span class="s2"&gt;`
  background-color: green;
  width: 150px;
  height: 50px;
  border: none;
  border-radius: 10px;
  color: white;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;TestButton&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="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;;&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="s2"&gt;```

``

This is the Styled Component syntax, a bit weird if you have never used it before but it makes sense once you do use it. It's basically just **CSS** wrapped inside of **``**quotes.

Now we need to return our button in our **TestButton** function.



`````&lt;/span&gt;&lt;span class="nx"&gt;jsx&lt;/span&gt;

&lt;span class="k"&gt;import&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="s1"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;styled&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;styled-components&lt;/span&gt;&lt;span class="dl"&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;Button&lt;/span&gt; &lt;span class="o"&gt;=&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;button&lt;/span&gt;
  &lt;span class="nx"&gt;background&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;green&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;150&lt;/span&gt;&lt;span class="nx"&gt;px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="nx"&gt;px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;border&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;none&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nx"&gt;border&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;radius&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="nx"&gt;px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;white&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;align&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;decoration&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;none&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;inline&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;block&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nx"&gt;font&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="nx"&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;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;TestButton&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="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Button&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;Button&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;;&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="s2"&gt;```

``

And we can go ahead and import it to our **App.js.**

``

```&lt;/span&gt;&lt;span class="nx"&gt;jsx&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;logo&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./logo.svg&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./App.css&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&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;TestButton&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="s1"&gt;./components/Buttons/TestButton.jsx&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="nf"&gt;App&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="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;'App'&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;header&lt;/span&gt; &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;'App-header'&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;img&lt;/span&gt; &lt;span class="na"&gt;src&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;logo&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;'App-logo'&lt;/span&gt; &lt;span class="na"&gt;alt&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;'logo'&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;TestButton&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;TEXT&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;TestButton&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;header&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;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;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;App&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="s2"&gt;```

``

I cleaned up the App.js file a bit and just left the React logo in there,  importing our TestButton below.

I also went ahead and added some TEXT between our &amp;lt;TestButton&amp;gt;TEXT&amp;lt;/TestButton&amp;gt;

What we now see is this:

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

As you can see, we don't have **TEXT** on our button. This is because we didn't give our Button component a **children prop**. 

## Styled Component Props

To be able to change or add some text after importing our TestButton component, we need to make sure to pass a **children prop** to our TestButton component.

So back to our **TestButton.jsx** file.

``

```&lt;/span&gt;&lt;span class="nx"&gt;jsx&lt;/span&gt;
&lt;span class="k"&gt;import&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="s1"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;styled&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;styled-components&lt;/span&gt;&lt;span class="dl"&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;Button&lt;/span&gt; &lt;span class="o"&gt;=&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;button&lt;/span&gt;&lt;span class="s2"&gt;`
  background-color: green;
  width: 150px;
  height: 50px;
  border: none;
  border-radius: 10px;
  color: white;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;TestButton&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;children&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="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Button&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;children&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;Button&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;;&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="s2"&gt;```

``

I went ahead and passed { children } as an argument to our TestButton function, as well as between our Button HTML tags.

This allows us now to pass something (text) to the component after importing it.

If you click on save, you should already see TEXT popping up on our Button.

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

Now we basically have a fully functional, importable, re-usable component within our TestButton.jsx file that we can re-use wherever we want. 

But lo', you're probably already thinking about it: But can I still add some style to the Button individually **AFTER** importing it?!

Yes, yes, of course you can!

## Adding styles to an imported Component

That is fairly easy. The process is kind of similar to what we did with the **children** prop.

Back to our **TestButton.jsx** file.

Now, we need to pass another prop called **className** to our TestButton. First as a **function argument** next to children, and then once more **inside of our Button HTML tag**.

``

```&lt;/span&gt;&lt;span class="nx"&gt;jsx&lt;/span&gt;
&lt;span class="k"&gt;import&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="s1"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;styled&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;styled-components&lt;/span&gt;&lt;span class="dl"&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;Button&lt;/span&gt; &lt;span class="o"&gt;=&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;button&lt;/span&gt;&lt;span class="s2"&gt;`
  background-color: green;
  width: 150px;
  height: 50px;
  border: none;
  border-radius: 10px;
  color: white;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;TestButton&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;children&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;className&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="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Button&lt;/span&gt; &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;children&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;Button&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;;&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="s2"&gt;```

``

Now back in our **App.js** we need to create another **Styled Component**, which **inherits all styles from our TestButton Component**, plus the styles you assign to it.

To be able to do that, you need to also import styled-components where ever you want to create this modified component, in our case inside of our App.js file. 

So make sure to have ***import styled from 'styled-components'*** at the top of your file.

``

```&lt;/span&gt;&lt;span class="nx"&gt;jsx&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;logo&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./logo.svg&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./App.css&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&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;TestButton&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="s1"&gt;./components/Buttons/TestButton.jsx&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;styled&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;styled-components&lt;/span&gt;&lt;span class="dl"&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;ModifiedTestButton&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;styled&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;TestButton&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;`
  background-color: red;
  font-size: 2rem;
  font-weight: bold;
`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;App&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="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;'App'&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;header&lt;/span&gt; &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;'App-header'&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;img&lt;/span&gt; &lt;span class="na"&gt;src&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;logo&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;'App-logo'&lt;/span&gt; &lt;span class="na"&gt;alt&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;'logo'&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;ModifiedTestButton&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;TEXT&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;ModifiedTestButton&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;header&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;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;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;App&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="s2"&gt;```

``

First you see that I created a **new Component called ModifiedTestButton**. I set this equal to **styled(TestButton)**, which is the name of our original button. 

Then I applied some styling to it. You can see that **I have changed the background color from green to red**, which means that everything that was inherited can be changed by merely changing the style without the need of something like !important. 

Obviously, anything new you add to it will also be applied, without changing your original Button component.

Also note that I have changed the **&amp;lt;TestButton&amp;gt;** HTML Tags to **&amp;lt;ModifiedTestButton&amp;gt;**.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/1vmi3ub7q15iiwlesxuj.jpg)

With all that in place we now have modified our original TestButton with a unique style.

## Conclusion

As you can probably see by now, Styled Components are a really powerful tool. 

I completely switched over from classic CSS files to Styled Components whenever I can. It is so cool to be able to re-use your components once you have created them.

You can go ahead and just store this TestButton.jsx file inside of your own react-components repository and you can go ahead and re-use it in different project with ease.

I already have a couple of Navbars, Buttons, Footers, etc inside of my repository that I can easily re-use in client projects.

This was my first article here on Dev.to! I hope you like it. The original article was published on my website [Ceos3c.com](https://www.ceos3c.com)

You can follow me on [YouTube](https://www.youtube.com/c/ceos3ctutorials) or you find me on Twitter @ceos3c

Happy Coding!

&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/ZqgC8otTKd0"&gt;
&lt;/iframe&gt;

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

&lt;/div&gt;

</description>
      <category>react</category>
      <category>styledcomponents</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
