<?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: Alex Crocker</title>
    <description>The latest articles on DEV Community by Alex Crocker (@crock).</description>
    <link>https://dev.to/crock</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%2F262877%2F653ae7f0-8c61-4e1b-bb51-6ff8fca66724.png</url>
      <title>DEV Community: Alex Crocker</title>
      <link>https://dev.to/crock</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/crock"/>
    <language>en</language>
    <item>
      <title>Gatsby.js Browser APIs Explained: wrapPageElement vs wrapRootElement</title>
      <dc:creator>Alex Crocker</dc:creator>
      <pubDate>Thu, 25 Mar 2021 15:51:24 +0000</pubDate>
      <link>https://dev.to/crock/gatsby-js-browser-apis-explained-wrappageelement-vs-wraprootelement-n4k</link>
      <guid>https://dev.to/crock/gatsby-js-browser-apis-explained-wrappageelement-vs-wraprootelement-n4k</guid>
      <description>&lt;p&gt;&lt;a href="https://gatsbyjs.com" rel="noopener noreferrer"&gt;Gatsby.js&lt;/a&gt; is a powerful and flexible &lt;a href="https://reactjs.org" rel="noopener noreferrer"&gt;React&lt;/a&gt; framework that's focused on generating static pages and content from various external data sources at build time. It has a suite of powerful browser and node apis to manipulate data and create any page you might need.&lt;/p&gt;

&lt;p&gt;Today I'm going to explain in-depth the difference between two fundamental  browser apis that you should know, &lt;a href="https://www.gatsbyjs.com/docs/reference/config-files/gatsby-browser/#wrapPageElement" rel="noopener noreferrer"&gt;wrapPageElement&lt;/a&gt; and &lt;a href="https://www.gatsbyjs.com/docs/reference/config-files/gatsby-browser/#wrapRootElement" rel="noopener noreferrer"&gt;wrapRootElement&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Both of these browser apis are typically defined in the &lt;code&gt;gatsby-browser.js&lt;/code&gt; file in the root of the project, but you can export both functions from &lt;code&gt;gatsby-ssr.js&lt;/code&gt; as well in some cases without having to duplicate the code.&lt;/p&gt;

&lt;h2&gt;
  
  
  wrapPageElement is for layouts
&lt;/h2&gt;

&lt;p&gt;First, the &lt;strong&gt;wrapPageElement&lt;/strong&gt; api is ideal for base layouts that every page has. It's not necessary to use this function, but if you don't want to have to add your base layout component to every page of your site, then using this api is a good way to save some typing. Under the hood, this is what &lt;a href="https://www.gatsbyjs.com/plugins/gatsby-plugin-layout/" rel="noopener noreferrer"&gt;gatsby-plugin-layout&lt;/a&gt; is using, so now you can remove that unnecessary plugin. &lt;/p&gt;

&lt;h2&gt;
  
  
  wrapRootElement is for providers
&lt;/h2&gt;

&lt;p&gt;Finally, the &lt;strong&gt;wrapRootElement&lt;/strong&gt; api is designed for wrapping your core application with all of your various providers. In the example source code below, I am using the &lt;a href="https://www.npmjs.com/package/react-alert" rel="noopener noreferrer"&gt;react-alert&lt;/a&gt; NPM package, which provides a convenient provider for us to demonstrate this api's usage. React Alert is a user-friendly library which provides hooks for customizing and displaying various alerts and notifications to the user.&lt;/p&gt;

&lt;p&gt;To sum up, Gatsby has plenty of other browser apis, but wrapPageElement and wrapRootElement are the two you will probably be using most often in your sites. If you just remember that wrapPageElement is for layouts and wrapRootElement is for providers, you will be on your way to being a Gatsby expert in no time!&lt;/p&gt;

&lt;h3&gt;
  
  
  Source Code
&lt;/h3&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="s2"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;

&lt;span class="c1"&gt;// Base Layout&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;Layout&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;./src/layouts/&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;

&lt;span class="c1"&gt;// react-alert&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;transitions&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;positions&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;Provider&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;AlertProvider&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;react-alert&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;AlertTemplate&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;react-alert-template-basic&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;alertOptions&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;position&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;positions&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;TOP_RIGHT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;timeout&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;5000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;offset&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;30px&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;transition&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;transitions&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;FADE&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;wrapPageElement&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;element&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;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Layout&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;element&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;Layout&lt;/span&gt;&lt;span class="p"&gt;&amp;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;wrapRootElement&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;element&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="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;AlertProvider&lt;/span&gt; &lt;span class="na"&gt;template&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;AlertTemplate&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;alertOptions&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;element&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;AlertProvider&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>gatsby</category>
      <category>javascript</category>
      <category>react</category>
    </item>
    <item>
      <title>p5.js Animated Water Texture</title>
      <dc:creator>Alex Crocker</dc:creator>
      <pubDate>Sun, 25 Oct 2020 01:51:36 +0000</pubDate>
      <link>https://dev.to/crock/p5-js-animated-water-texture-22jk</link>
      <guid>https://dev.to/crock/p5-js-animated-water-texture-22jk</guid>
      <description>&lt;p&gt;I created a subtle animated water texture that's reminiscent of Minecraft water while experimenting and tweaking the code that was used in the following video on creating procedural terrain generation using Perlin noise.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=IKB1hWWedMk" rel="noopener noreferrer"&gt;https://www.youtube.com/watch?v=IKB1hWWedMk&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/croc/embed/PozWxeX?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>codepen</category>
    </item>
    <item>
      <title>How to find the best lists of expiring domains for dropcatching</title>
      <dc:creator>Alex Crocker</dc:creator>
      <pubDate>Sun, 28 Jun 2020 19:31:50 +0000</pubDate>
      <link>https://dev.to/crock/how-to-find-the-best-lists-of-expiring-domains-for-dropcatching-481m</link>
      <guid>https://dev.to/crock/how-to-find-the-best-lists-of-expiring-domains-for-dropcatching-481m</guid>
      <description>&lt;p&gt;Dropcatching is the process of bidding on expiring domain names in hopes that the dropcatching service can successfully snipe the domain on your behalf as soon as it drops.&lt;/p&gt;

&lt;p&gt;All of the popular dropcatching services are competing and the one with the most resources allocated to any particular name will most likely win the snipe.&lt;/p&gt;

&lt;p&gt;It definitely helps to shop around for the best prices and take advantage of many of the free, downloadable lists that each dropcatching service provides. Using tools like &lt;a href="https://github.com/crock/dropfilter" rel="noopener noreferrer"&gt;Dropfilter&lt;/a&gt;, you can easily filter these huge lists based on customizable criteria.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GoDaddy Auctions&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://auctions.godaddy.com/trptools.aspx" rel="noopener noreferrer"&gt;https://auctions.godaddy.com/trptools.aspx&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="ftp://auctions@ftp.godaddy.com/"&gt;ftp://auctions@ftp.godaddy.com/&lt;/a&gt; (blank password)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Namejet&lt;/strong&gt;&lt;br&gt;
&lt;a href="http://www.namejet.com/Pages/Downloads.aspx" rel="noopener noreferrer"&gt;http://www.namejet.com/Pages/Downloads.aspx&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Dropcatch.com&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://www.dropcatch.com/DownloadCenter" rel="noopener noreferrer"&gt;https://www.dropcatch.com/DownloadCenter&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SnapNames&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://snapnames.com/download.action" rel="noopener noreferrer"&gt;https://snapnames.com/download.action&lt;/a&gt;&lt;/p&gt;

</description>
      <category>dropcatching</category>
      <category>domains</category>
      <category>domaining</category>
      <category>branding</category>
    </item>
    <item>
      <title>The Future of Social Media</title>
      <dc:creator>Alex Crocker</dc:creator>
      <pubDate>Sun, 28 Jun 2020 19:27:29 +0000</pubDate>
      <link>https://dev.to/crock/the-future-of-social-media-17n6</link>
      <guid>https://dev.to/crock/the-future-of-social-media-17n6</guid>
      <description>&lt;p&gt;I have been thinking on this topic for a long time and I believe the future of social media will not be centered around selling user data to advertisers, but selling “likes” as a currency.&lt;/p&gt;

&lt;p&gt;The successor to Facebook will have to find a way to successfully convince people that tipping their favorite content creators is normal. Not an easy feat by any means, but the beginnings of this idea can be seen in YouTube monetization, Twitch bits and subscriptions, and Medium applause. Combining these elements is the key.&lt;/p&gt;

&lt;p&gt;This new social network will allow all types of posts to be monetizeable, not just videos. Like Medium, likes will be basically limitless. A single user can like a post as many times as they want which roughly translates to more appreciation for the creator. Standard likes are free and common, but there are rarer tiers of likes that cost real money and have a higher appreciation value, which can factor in to trends and recommendation algorithms.&lt;/p&gt;

&lt;p&gt;Take a look at this &lt;a href="https://twitter.com/i/moments/1056893922419580931" rel="noopener noreferrer"&gt;Twitter Moment&lt;/a&gt; for more on this topic.&lt;/p&gt;

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