<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Hooks on BradCypert.com</title>
    <link>https://www.bradcypert.com/tags/hooks/</link>
    <description>Recent content in Hooks on BradCypert.com</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Thu, 30 Mar 2023 14:16:04 -0400</lastBuildDate>
    <atom:link href="https://www.bradcypert.com/tags/hooks/index.xml" rel="self" type="application/rss+xml" />
    <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>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>
  </channel>
</rss>
