<?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: firedev99</title>
    <description>The latest articles on DEV Community by firedev99 (@firedev99).</description>
    <link>https://dev.to/firedev99</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%2F366668%2F74971603-248b-4bed-8a56-1c677e397bc4.jpeg</url>
      <title>DEV Community: firedev99</title>
      <link>https://dev.to/firedev99</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/firedev99"/>
    <language>en</language>
    <item>
      <title>Hey, I'm trying to deploy a site with gatsby but I'm getting an error</title>
      <dc:creator>firedev99</dc:creator>
      <pubDate>Wed, 13 May 2020 14:28:29 +0000</pubDate>
      <link>https://dev.to/firedev99/hey-i-m-trying-to-deploy-a-site-with-gatsby-but-i-m-getting-an-error-1df0</link>
      <guid>https://dev.to/firedev99/hey-i-m-trying-to-deploy-a-site-with-gatsby-but-i-m-getting-an-error-1df0</guid>
      <description>&lt;p&gt;so I'm getting an error saying cannot destructure property 'currentTheme' object as it is undefined &lt;/p&gt;

&lt;p&gt;//Layout&lt;br&gt;
  const {currentTheme, cursorStyles} = useGlobalStateContext()&lt;br&gt;
  const dispatch = useGlobalDispatchContext()&lt;/p&gt;

&lt;p&gt;//GlobalContext&lt;br&gt;
const globalReducer = (state, action) =&amp;gt; {&lt;br&gt;
    switch(action.type) {&lt;br&gt;
        case "TOGGLE_THEME": {&lt;br&gt;
            return {&lt;br&gt;
                ...state,&lt;br&gt;
                currentTheme: action.theme,&lt;br&gt;
            }&lt;br&gt;
        }&lt;br&gt;
        case "CURSOR_TYPE": {&lt;br&gt;
            return {&lt;br&gt;
                ...state,&lt;br&gt;
                cursorType: action.cursorType,&lt;br&gt;
            }&lt;br&gt;
        }&lt;br&gt;
        default : {&lt;br&gt;
            throw new Error(&lt;code&gt;unhandled action type: ${action.type}&lt;/code&gt;)&lt;br&gt;
        }&lt;br&gt;
    }&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;//Provider&lt;br&gt;
export const GlobalProvider = ({children}) =&amp;gt; {&lt;br&gt;
    const [state, dispatch] = useReducer(globalReducer, {&lt;br&gt;
        currentTheme: window.localStorage.getItem("theme") === null ? "dark" : window.localStorage.getItem("theme"),&lt;br&gt;
        cursorType: false, &lt;br&gt;
        cursorStyles: ["pointer", "hovered", "nav-open"]&lt;br&gt;
    })&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
