<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>React on BradCypert.com</title>
    <link>https://www.bradcypert.com/tags/react/</link>
    <description>Recent content in React on BradCypert.com</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Thu, 30 Mar 2023 22:45:17 -0400</lastBuildDate>
    <atom:link href="https://www.bradcypert.com/tags/react/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Testing React Components with React Testing Library</title>
      <link>https://www.bradcypert.com/testing-react-components-with-react-testing-library/</link>
      <pubDate>Sat, 15 Feb 2020 00:00:00 +0000</pubDate>
      <guid>https://www.bradcypert.com/testing-react-components-with-react-testing-library/</guid>
      <description>&lt;iframe width=&#34;560&#34; height=&#34;315&#34; src=&#34;https://www.youtube-nocookie.com/embed/d8GRDqjFP-g&#34; frameborder=&#34;0&#34; allow=&#34;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&#34; allowfullscreen&gt;&lt;/iframe&gt;&#xA;&lt;p&gt;Testing react components with React Testing Library can be tricky, so I decided to&#xA;try something new and put together a video demonstrating how to test your react components.&lt;/p&gt;&#xA;&lt;p&gt;I’ll work on improving the audio quality going forward, but I’d love to know&#xA;your thoughts! Wanna see more content like this in the future? Lemme know!&lt;/p&gt;</description>
    </item>
    <item>
      <title>Managing Authentication with React&#39;s useContext Hook</title>
      <link>https://www.bradcypert.com/react-usecontext-hook/</link>
      <pubDate>Tue, 11 Feb 2020 00:00:00 +0000</pubDate>
      <guid>https://www.bradcypert.com/react-usecontext-hook/</guid>
      <description>&lt;p&gt;Contexts are a commonly used tool when building React libraries, but are often overlooked when building an application in React. I don’t believe that should be the case, as useContext can provide you a powerful alternative (but lightweight) alternative to tools like Redux when managed carefully.&lt;/p&gt;&#xA;&lt;p&gt;The &lt;a href=&#34;https://reactjs.org/docs/hooks-reference.html#usecontext&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;classic example of using a context is to declare an app theme&lt;/a&gt;&#xA; but we can use them for so much more than that. In fact, we’re going to leverage a context today to demonstrate how simple authentication can be handled with React’s useContext hook.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Understanding React Lifecycle Methods</title>
      <link>https://www.bradcypert.com/understanding-react-lifecycle-methods/</link>
      <pubDate>Wed, 05 Feb 2020 00:00:00 +0000</pubDate>
      <guid>https://www.bradcypert.com/understanding-react-lifecycle-methods/</guid>
      <description>&lt;p&gt;React Lifecycle Methods are one tricky piece of business, especially if you’re coming from a framework that doesn’t have their own. Thankfully, they’re fairly similar to Android’s lifecycle methods and it wasn’t long before I was able to grasp them.&lt;/p&gt;&#xA;&lt;p&gt;React has changed a lot over the past few years and it’s lifecycle methods are no exceptions. In fact, with the release of hooks, the idea of lifecycles were shaken once more!&lt;/p&gt;</description>
    </item>
    <item>
      <title>How do I use TypeScript with React?</title>
      <link>https://www.bradcypert.com/how-do-i-use-typescript-with-react/</link>
      <pubDate>Sat, 11 Jan 2020 00:00:00 +0000</pubDate>
      <guid>https://www.bradcypert.com/how-do-i-use-typescript-with-react/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;https://reactjs.org/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;React&lt;/a&gt;&#xA; is allowing developers to iterate faster and build safer, more reliable frontend applications than we were building many years ago. &lt;a href=&#34;https://www.typescriptlang.org/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;TypeScript&lt;/a&gt;&#xA;, a relatively new addition to the “JavaScript Alternatives” scene, also aims to add a new level of safety in the form of type safety. Naturally, it makes sense for us to want to use TypeScript to write React components.&lt;/p&gt;&#xA;&lt;p&gt;But how do you do that? There are two different ways.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Fetching Data with React Hooks</title>
      <link>https://www.bradcypert.com/fetching-data-with-react-hooks/</link>
      <pubDate>Thu, 09 Jan 2020 00:00:00 +0000</pubDate>
      <guid>https://www.bradcypert.com/fetching-data-with-react-hooks/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;https://reactjs.org/docs/hooks-intro.html&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;React hooks have changed the way that I (and arguably the React Community) prefer to build components&lt;/a&gt;&#xA;. I’ve been working on a GraphQL project for a while, and when we migrated to functional components and hooks, I was able to use&lt;a href=&#34;https://www.apollographql.com/docs/react/api/react-hooks/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt; Apollo’s hooks&lt;/a&gt;&#xA; for my data fetching needs. However, I find myself now working on a new project that doesn’t use GraphQL. Consequentially, I find myself wondering “How do I fetch data with React Hooks?”&lt;/p&gt;</description>
    </item>
    <item>
      <title>Autosaving with React Hooks</title>
      <link>https://www.bradcypert.com/autosaving-with-react-hooks/</link>
      <pubDate>Sat, 21 Dec 2019 00:00:00 +0000</pubDate>
      <guid>https://www.bradcypert.com/autosaving-with-react-hooks/</guid>
      <description>&lt;p&gt;React hooks have really changed the game for me when it comes to building react components. However, I’ve found that writing autosaving functionality is a little less obvious via hooks. Thankfully, it is still possible (and arguably a lot cleaner) when using hooks.&lt;/p&gt;&#xA;&lt;p&gt;We can accomplish autosaving functionality through use of &lt;code&gt;useEffect&lt;/code&gt;. You’ll also need a way to post the data to your server. In my case, I’m using Apollo’s useMutation hook as well. This allows me to post a graphql mutation from a hook-like interface.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Auth Guarding React Router Routes</title>
      <link>https://www.bradcypert.com/auth-guarding-react-router-routes/</link>
      <pubDate>Sun, 27 Oct 2019 00:00:00 +0000</pubDate>
      <guid>https://www.bradcypert.com/auth-guarding-react-router-routes/</guid>
      <description>&lt;p&gt;A common theme in web applications is to serve specific content to authenticated users while serving other content to everyone else. I’ve heard this referred to in the past as “auth guarding” specific content. In this case of our example today, we want to auth guard react-router routes.&lt;/p&gt;&#xA;&lt;p&gt;There are a couple of different ways to do this, but I’ve found a pattern that I really like that uses higher-order function components to help create the functionality that would be expected of an auth guarded route. Namely, we show them an unauthorized screen if they’re not authorized and, if they are authorized to view that content, we show them the content.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
