<?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: Chibuzo Franklin Odigbo</title>
    <description>The latest articles on DEV Community by Chibuzo Franklin Odigbo (@franklivania).</description>
    <link>https://dev.to/franklivania</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%2F1141776%2Fd8006885-2960-4752-9ddf-32019f041a50.jpeg</url>
      <title>DEV Community: Chibuzo Franklin Odigbo</title>
      <link>https://dev.to/franklivania</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/franklivania"/>
    <language>en</language>
    <item>
      <title>Wrote an article for people who wanted to use plain JS to build React Native projects, and showed how to configure with expo to use its advantages</title>
      <dc:creator>Chibuzo Franklin Odigbo</dc:creator>
      <pubDate>Tue, 02 Dec 2025 15:33:53 +0000</pubDate>
      <link>https://dev.to/franklivania/wrote-an-article-for-people-who-wanted-to-use-plain-js-to-build-react-native-projects-and-showed-4910</link>
      <guid>https://dev.to/franklivania/wrote-an-article-for-people-who-wanted-to-use-plain-js-to-build-react-native-projects-and-showed-4910</guid>
      <description>&lt;p&gt;

&lt;/p&gt;
&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/franklivania/plain-reactnative-expo-setup-with-pure-javascript-2ehj" class="crayons-story__hidden-navigation-link"&gt;Plain ReactNative-Expo setup with pure JavaScript&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;

          &lt;a href="/franklivania" class="crayons-avatar  crayons-avatar--l  "&gt;
            &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1141776%2Fd8006885-2960-4752-9ddf-32019f041a50.jpeg" alt="franklivania profile" class="crayons-avatar__image"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/franklivania" class="crayons-story__secondary fw-medium m:hidden"&gt;
              Chibuzo Franklin Odigbo
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                Chibuzo Franklin Odigbo
                
              
              &lt;div id="story-author-preview-content-3079469" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/franklivania" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&gt;
                        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1141776%2Fd8006885-2960-4752-9ddf-32019f041a50.jpeg" class="crayons-avatar__image" alt=""&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;Chibuzo Franklin Odigbo&lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

          &lt;/div&gt;
          &lt;a href="https://dev.to/franklivania/plain-reactnative-expo-setup-with-pure-javascript-2ehj" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;Dec 2 '25&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/franklivania/plain-reactnative-expo-setup-with-pure-javascript-2ehj" id="article-link-3079469"&gt;
          Plain ReactNative-Expo setup with pure JavaScript
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/reactnative"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;reactnative&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/javascript"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;javascript&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/beginners"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;beginners&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/mobile"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;mobile&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
            &lt;a href="https://dev.to/franklivania/plain-reactnative-expo-setup-with-pure-javascript-2ehj#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              Comments


              &lt;span class="hidden s:inline"&gt;Add Comment&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            4 min read
          &lt;/small&gt;
            
              &lt;span class="bm-initial"&gt;
                

              &lt;/span&gt;
              &lt;span class="bm-success"&gt;
                

              &lt;/span&gt;
            
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;




</description>
      <category>reactnative</category>
      <category>javascript</category>
      <category>beginners</category>
      <category>mobile</category>
    </item>
    <item>
      <title>Plain ReactNative-Expo setup with pure JavaScript</title>
      <dc:creator>Chibuzo Franklin Odigbo</dc:creator>
      <pubDate>Tue, 02 Dec 2025 15:32:39 +0000</pubDate>
      <link>https://dev.to/franklivania/plain-reactnative-expo-setup-with-pure-javascript-2ehj</link>
      <guid>https://dev.to/franklivania/plain-reactnative-expo-setup-with-pure-javascript-2ehj</guid>
      <description>&lt;p&gt;Hello guys, I am writing this article, for people like me, in case you want the do things plainly, and just have a working system with JavaScript, without the default typescript configuration that &lt;a href="https://docs.expo.dev" rel="noopener noreferrer"&gt;Expo&lt;/a&gt; usually bundles with.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Presets&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Bun: Package manager&lt;/li&gt;
&lt;li&gt;SDK: 54.0.25&lt;/li&gt;
&lt;li&gt;Language: JavaScript&lt;/li&gt;
&lt;li&gt;Command Interface: Bash integrated into terminal&lt;/li&gt;
&lt;li&gt;OS: Windows&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For the sake of this article, I would be using &lt;code&gt;bun&lt;/code&gt;, as my package manager, and will work with you along with some smooth fixes for a finish. It should not take long.&lt;/p&gt;

&lt;p&gt;You can run this command to use the template directly with no overhead. Leave a star please, thank you 😉&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;degit https://github.com/Franklivania/expo-js-starter.git &amp;lt;your-project-name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Creating the application.
&lt;/h2&gt;

&lt;p&gt;Now, we want to initalise a new react-native/expo application to start work with. To install it bare, with no attachments or prior configurations, we would run &lt;/p&gt;

&lt;p&gt;&lt;code&gt;bun create expo –-template blank &amp;lt;project-name&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;That would install a bare-bones project for you and give you directives to get into it. You then navigate to it and pop it up from your terminal. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;NB: I am using bash on windows terminal, so I have access to Linux style commands. I recommend you do the same, as you will find it amazing, in my opinion. Mac users work with the same commands, as it is Unix styled. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;code&gt;cd &amp;lt;project-name&amp;gt; &amp;amp;&amp;amp; cursor .&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://cursor.com" rel="noopener noreferrer"&gt;Cursor&lt;/a&gt; is my IDE of choice. &lt;/p&gt;

&lt;p&gt;Once you have it open, you would want to start configuring the application to use expo proper, give you access to its robust libraries. &lt;/p&gt;

&lt;p&gt;You would need to install a whole bunch of dependencies from scratch, but don’t worry, I have them all here, so you do not worry&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;bun install react-native-reanimated react-native-screens lucide-react-native expo-haptics expo-router expo-image expo-linking expo-font expo-constants expo-blur expo-system-ui react-native-web react-native-worklets react-native-safe-area-context @react-native-community/netinfo @react-native-async-storage/async-storage@next @react-navigation/bottom-tabs @react-navigation/elements @react-navigation/native expo-splash-screen react-dom react-native-svg 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Those are all the components you would need to install to get things working. &lt;/p&gt;

&lt;p&gt;Now, it is time to dig into the config files to set it up properly. &lt;/p&gt;

&lt;h3&gt;
  
  
  The configuration.
&lt;/h3&gt;

&lt;p&gt;Now, if you look at the bare bones application, you would only be served with some bare folders, which we would be modifying and adding to, to have a functional application that utilises expo properly. &lt;/p&gt;

&lt;p&gt;Below is a before and after comparison &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffy3seqjqxcri02q76zhj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffy3seqjqxcri02q76zhj.png" alt="Initial Setup" width="251" height="256"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frvswkgkna0ri9gsajt2u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frvswkgkna0ri9gsajt2u.png" alt="Setup after configuration" width="253" height="316"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can see the progressive difference between the two. The first one serves through index.js, while the second follows and server expo properly. &lt;/p&gt;

&lt;h3&gt;
  
  
  Setting Up jsconfig.json
&lt;/h3&gt;

&lt;p&gt;First, to have dynamic calls withing your application, and not falling into the directory deep drive overhaul, you should set up your &lt;code&gt;jsconfig.json&lt;/code&gt; file to declare your directory for relative paths. It should look like this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; 

  &lt;/span&gt;&lt;span class="nl"&gt;"compilerOptions"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; 

    &lt;/span&gt;&lt;span class="nl"&gt;"paths"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; 

      &lt;/span&gt;&lt;span class="nl"&gt;"@/*"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"./src/*"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt; 

      &lt;/span&gt;&lt;span class="nl"&gt;"~/*"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"./assets/*"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; 

    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt; 

  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt; 

&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This should configure your directories proper for use. This is optional. &lt;/p&gt;

&lt;h3&gt;
  
  
  Configuring Babel
&lt;/h3&gt;

&lt;p&gt;Now, we configure our babel to recoginise and utilise various presets for the application. This helps in bundling and serving the heavy directives. Your babel.config.js should look like this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;exports&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;function &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;api&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; 

  &lt;span class="nx"&gt;api&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;cache&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;true&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="na"&gt;presets&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;babel-preset-expo&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; 

    &lt;span class="na"&gt;plugins&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;react-native-worklets/plugin&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; 

  &lt;span class="p"&gt;}&lt;/span&gt; 

&lt;span class="p"&gt;}&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once you are done, you move to your &lt;code&gt;app.json&lt;/code&gt;. Configuring this setup for expo use is necessary, as it serves as a place for you to declare the entry point serve your application. &lt;/p&gt;

&lt;h3&gt;
  
  
  Setting up app.json
&lt;/h3&gt;

&lt;p&gt;In here, you need to add the scheme to the top level of the application, add the plugins section to expose the “expo-router” and “expo-splash-screen” &lt;/p&gt;

&lt;p&gt;You would add this inside your &lt;code&gt;app.json&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"plugins"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt; 

      &lt;/span&gt;&lt;span class="s2"&gt;"expo-router"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; 

      &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt; 

        &lt;/span&gt;&lt;span class="s2"&gt;"expo-splash-screen"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; 

        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; 

          &lt;/span&gt;&lt;span class="nl"&gt;"image"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"./assets/images/splash-icon.png"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; 

          &lt;/span&gt;&lt;span class="nl"&gt;"imageWidth"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; 

          &lt;/span&gt;&lt;span class="nl"&gt;"resizeMode"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"contain"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; 

          &lt;/span&gt;&lt;span class="nl"&gt;"backgroundColor"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"#ffffff"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; 

          &lt;/span&gt;&lt;span class="nl"&gt;"dark"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; 

            &lt;/span&gt;&lt;span class="nl"&gt;"backgroundColor"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"#000000"&lt;/span&gt;&lt;span class="w"&gt; 

          &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt; 

        &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt; 

      &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; 

    &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; 
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once that is added, it just remains one last step, redeclaring your entry point from index.js to expo-router/entry. You will modify the main key at the top of your &lt;code&gt;package.json&lt;/code&gt;. What that does, is to tell expo where it should serve your application from. Usually, your entry point would be located at &lt;code&gt;/app/_layout.jsx&lt;/code&gt;, or &lt;code&gt;/src/app/_layout.jsx&lt;/code&gt;. Expo automatically finds this, and serves it all up with no hassles. With this setup, you are good to go. &lt;/p&gt;

&lt;h3&gt;
  
  
  One more thing.
&lt;/h3&gt;

&lt;p&gt;You want to make sure you are running compatible dependency versions with the current expo version. This is so that your application can be built with no issues when you deploy via EAS. &lt;/p&gt;

&lt;p&gt;So, you run &lt;/p&gt;

&lt;p&gt;&lt;code&gt;bunx expo-doctor&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;That runs tests on your dependency array, and checks how fit your application is, like a normal doctor. If you encounter some outdated versions, or you need to set some versions to work properly, you simply run &lt;/p&gt;

&lt;p&gt;&lt;code&gt;bunx expo install -–check&lt;/code&gt; &lt;/p&gt;

&lt;p&gt;That checks your dependencies, and updates them to the versions compatible with the expo SDK. &lt;/p&gt;

&lt;p&gt;At this point, it is safe to delete your index.js and App.js files, as you have defined your entry points properly. &lt;/p&gt;

&lt;p&gt;Alright guys, hope this helped you, and you can take it from here. &lt;/p&gt;

&lt;p&gt;Cheers 🍻. And happy coding 💻&lt;/p&gt;

</description>
      <category>reactnative</category>
      <category>javascript</category>
      <category>beginners</category>
      <category>mobile</category>
    </item>
    <item>
      <title>Setting up twin.macro with Vite + React</title>
      <dc:creator>Chibuzo Franklin Odigbo</dc:creator>
      <pubDate>Thu, 13 Jun 2024 14:34:16 +0000</pubDate>
      <link>https://dev.to/franklivania/setting-up-twinmacro-with-vite-react-18na</link>
      <guid>https://dev.to/franklivania/setting-up-twinmacro-with-vite-react-18na</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Recently, I encountered a project which worked with twin macro. My first thought was that Tailwind is already perfect, so why want more? Then I started to use twin.macro, and I have gotten addicted to it. Not only does it have massive flexibility in styling, but you can also use it with emotion, or styled-components, and it is very clean too, when combined with it’s vs code IntelliSense extension.&lt;/p&gt;

&lt;p&gt;So, my goal was to go from having my tailwind looking like this&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const SpanStyled = ({ active, children }) =&amp;gt; (
  &amp;lt;span className={`px-9 py-2 font-bienvenido text-base cursor-pointer rounded-full 
    ${active ? 'bg-brown-600 text-white' : 'bg-transparent text-black'} 
    hover:bg-brown-200`}&amp;gt;
    {children}
  &amp;lt;/span&amp;gt;
);

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

&lt;/div&gt;

&lt;p&gt;to this&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const SpanStyled = styled.span(({ active }: { active: boolean }) =&amp;gt; [
  tw`px-9 py-2 font-bienvenido text-base cursor-pointer rounded-full hocus:(bg-brown-20)`,
  active ? tw`bg-brown-600 text-white-900` : tw`bg-transparent text-black-900`
])

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

&lt;/div&gt;

&lt;p&gt;I do not need to tell you which would be easier to maintain.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Setup
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Starting with tailwind and dependency installs
&lt;/h3&gt;

&lt;p&gt;Aight, let's jump into it. This is a step-by-step process, which would help you use and be able to set up twin.macro for your vite + react or any other project you bootstrap with vite (I think).&lt;/p&gt;

&lt;p&gt;So you have to do the first things first, bootstrap your project as so;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm create vite@latest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;I used the typescript variant. So, you follow the prompt.&lt;br&gt;
Then you install tailwind and its cohorts.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install @emotion/styled @emotion/css
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install -D tailwindcss autoprefixer postcss twin.macro babel-plugin-macros vite-plugin-babel-macros @emotion/babel-plugin @emotion/babel-plugin-jsx-pragmatic @types/babel-plugin-macros @babel/plugin-transform-react-jsx

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

&lt;/div&gt;

&lt;p&gt;Aight, when you have installed all these, you would then need to initialise your tailwind with the postcss and autoprefixer, so you do;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx tailwindcss init -p
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Don't forget to add these&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@tailwind base;
@tailwind components;
@tailwind utilities;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;to your &lt;code&gt;tailwindconfig.json&lt;/code&gt;, inside the content object,&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; "./index.html",
    "./src/**/*.{js,ts,jsx,tsx}",
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Folder and file configs for usage
&lt;/h3&gt;

&lt;p&gt;Okay, we are all done with that. Now to the entire configurations.&lt;br&gt;
Now, if you follow &lt;a href="https://github.com/ben-rogerson/twin.examples/tree/master/vite-emotion-typescript" rel="noopener noreferrer"&gt;Ben Rogerson’s docs&lt;/a&gt; in his explanation, you will see the ability to add the babel field to your &lt;code&gt;package.json&lt;/code&gt;, or to create a babel-plugin-macros.config.js file and add some code to it. I would suggest you rename it to &lt;code&gt;.mjs&lt;/code&gt;, instead of &lt;code&gt;.js&lt;/code&gt;&lt;br&gt;
If you are adding to the package.json, you add;&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"babelMacros": {
  "twin": {
    "preset": "emotion"
  }
},
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Then, if you are creating the babel config, you add this;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;module.exports = {
  twin: {
    preset: 'emotion',
  },
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Alright, well done for coming this distance. All that remains for you to update is your vite.config, add your twin.d.ts, modify your tsconfig.json, and create and import your global styles. It is super easy.&lt;br&gt;
For your &lt;code&gt;vite.config.ts&lt;/code&gt;, or &lt;code&gt;js&lt;/code&gt; for whichever, replace with this;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import macrosPlugin from 'vite-plugin-babel-macros'

// https://vitejs.dev/config/
export default defineConfig({
  optimizeDeps: {
    esbuildOptions: {
      target: 'es2020',
    },
  },
  esbuild: {
    jsxFactory: 'jsx',
    jsxInject: 'import { jsx } from "@emotion/react"',
    logOverride: { 'this-is-undefined-in-esm': 'silent' },
  },
  plugins: [
    react({
      babel: {
        plugins: [
          'babel-plugin-macros',
          [
            '@emotion/babel-plugin-jsx-pragmatic',
            {
              export: 'jsx',
              import: '__cssprop',
              module: '@emotion/react',
            },
          ],
          [
            '@babel/plugin-transform-react-jsx',
            { pragma: '__cssprop' },
            'twin.macro',
          ],
        ],
      },
    }),
    macrosPlugin(),
  ],
  define: {
    'process.env': {},
  },
})

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

&lt;/div&gt;

&lt;p&gt;When you are done with that, you then create a &lt;code&gt;types&lt;/code&gt; folder at the root of your project and create a &lt;code&gt;twin.d.ts&lt;/code&gt; or &lt;code&gt;js&lt;/code&gt;, dependent, and add this&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import 'twin.macro'
import { css as cssImport } from '@emotion/react'
import styledImport from '@emotion/styled'
import { CSSInterpolation } from '@emotion/serialize'

declare module 'twin.macro' {
  // The styled and css imports
  const styled: typeof styledImport
  const css: typeof cssImport
}

declare module 'react' {
  // The tw and css prop
  interface DOMAttributes&amp;lt;T&amp;gt; {
    tw?: string
    css?: CSSInterpolation
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;In my case, I also created a &lt;code&gt;.babelrc.js&lt;/code&gt;, and then added this to it &lt;code&gt;_this is not necessary!_&lt;/code&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;module.exports = {
  presets: [
    [
      "next/babel",
      {
        "preset-react": {
          runtime: "automatic",
          importSource: "@emotion/react",
        },
      },
    ],
  ],
  plugins: ["@emotion/babel-plugin", "babel-plugin-macros"],
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The only places we need to modify in our tsconfig.json, are;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"skipLibCheck": true,
"jsxImportSource": "@emotion/react",
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;and&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
"include": ["src", "types"],
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Here, you would just add “types”, to the already existing src that is there, and you are good to go.&lt;br&gt;
Then, you create a styles folder inside your src folder and create a &lt;code&gt;GlobalStyles.tsx&lt;/code&gt; inside it. Then you would place this code inside it&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React from 'react'
import { Global } from '@emotion/react'
import tw, { css, theme, GlobalStyles as BaseStyles } from 'twin.macro'

const customStyles = css({
  body: {
    WebkitTapHighlightColor: theme`colors.purple.500`,
    ...tw`antialiased`,
  },
})

const GlobalStyles = () =&amp;gt; (
  &amp;lt;&amp;gt;
    &amp;lt;BaseStyles /&amp;gt;
    &amp;lt;Global styles={customStyles} /&amp;gt;
  &amp;lt;/&amp;gt;
)

export default GlobalStyles
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;after you would then import it to your main.tsx, so it affects your application globally. Then, you are good to use twin.macro to start styling your components.&lt;/p&gt;

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

&lt;p&gt;So, when you are done setting it up, you should be able to edit your code optimally, and use the &lt;code&gt;tw&lt;/code&gt;, instead of the &lt;code&gt;className&lt;/code&gt;. Also note you have to import &lt;code&gt;tw&lt;/code&gt; at the head of each document as you start to work on it.&lt;/p&gt;

&lt;p&gt;So, from 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%2Fuploads%2Farticles%2Fe45reu0echml7xq8qz0x.png" 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%2Fuploads%2Farticles%2Fe45reu0echml7xq8qz0x.png" alt="App.tsx before"&gt;&lt;/a&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%2Fuploads%2Farticles%2F8uh4gokdtwgtaaw6swnl.png" 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%2Fuploads%2Farticles%2F8uh4gokdtwgtaaw6swnl.png" alt="main.tsx before"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;we have 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%2Fuploads%2Farticles%2F5dz4rrlx9nrcb3vyyuhm.png" 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%2Fuploads%2Farticles%2F5dz4rrlx9nrcb3vyyuhm.png" alt="App.tsx after"&gt;&lt;/a&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%2Fuploads%2Farticles%2F67bnab61zav0mcumalz4.png" 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%2Fuploads%2Farticles%2F67bnab61zav0mcumalz4.png" alt="main.tsx after"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you want access to the file itself, and see how it was done, this is the repository here&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://github.com/Franklivania/vite-twin.gitv
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Cheers and happy coding 🍻&amp;amp;💖&lt;/p&gt;

</description>
      <category>react</category>
      <category>tailwindcss</category>
      <category>javascript</category>
      <category>vite</category>
    </item>
    <item>
      <title>Front-end development: The world in it</title>
      <dc:creator>Chibuzo Franklin Odigbo</dc:creator>
      <pubDate>Sun, 11 Feb 2024 13:26:19 +0000</pubDate>
      <link>https://dev.to/franklivania/front-end-development-the-world-in-it-5fk1</link>
      <guid>https://dev.to/franklivania/front-end-development-the-world-in-it-5fk1</guid>
      <description>&lt;h2&gt;
  
  
  The warm-up
&lt;/h2&gt;

&lt;p&gt;It is no fluke there is a plethora of front-end developers in the tech space, and there are many more who aspire to walk down that part. It is just &lt;code&gt;HTML&lt;/code&gt; and &lt;code&gt;CSS&lt;/code&gt;, isn’t it? This is the mindset people would use to approach the space. Now, in the space, they discover all the issues that come with frontend development, and they come to the realization of it, then, the hassle starts.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is frontend development?
&lt;/h2&gt;

&lt;p&gt;I can define this by posting what research has said, and what some other article has said about the subject, but my job is to bake cakes on the internet, so why don’t I give you a slice of what I have baked 😉.&lt;/p&gt;

&lt;p&gt;It is necessary to understand what exactly you are doing. Take this instance. You go up to order a meal from your popular meal vendor, and no one comes to answer you, instead, you go to the kitchen, and would have to locate all the ingredients to make the food, and then, you start to prepare. There is no sort of interaction which has kept the meal for you, and you waste time trying to get your meal as you have to prepare it.&lt;/p&gt;

&lt;p&gt;Or, imagine you have to get an item from the store, and they are all in boxes. Then you have to search through each box to get what you need. All the hassle and time wasted getting you what you need.&lt;/p&gt;

&lt;p&gt;This is where front-end developers come in. They are the waiters who come to take your order, and the store-men who place your items on the rack and tag their prices, so you can access your products easily, and save all your time and energy trying to understand and comprehend how to locate your stuff.&lt;/p&gt;

&lt;h2&gt;
  
  
  Front-end development as a practice.
&lt;/h2&gt;

&lt;p&gt;It is common nowadays to see a large flux of developers move from frontend development to another practice because of the “complexities” which follow the craft once they see it is not all about HTML and CSS. Even in these two, massive complexities are faced trying to master them. The usual issues usually arise when you have an alignment issue from your design, and you try to rectify them, and you create more issues than the one you have supposedly solved! Terrifying right 🥶🤧. Yes, and this causes a lot of issues when it comes to CSS. Another fundamental example is when you fail to describe the accurate &lt;code&gt;class name&lt;/code&gt; or &lt;code&gt;id&lt;/code&gt; for your HTML element, and you are done with your CSS styling which is supposed to reflect, and nothing happens. You start to debug, even to the extent of deleting the entire file. Yes, it is very draining. But this is my field.&lt;/p&gt;

&lt;p&gt;Nowadays, frontend development has taken a wide innovation spectrum, from clickable buttons to interactive 3D game-like modes, which enable users to be able to interact with the website. There is now a plethora of frameworks which are available for use to create and generate intuitive web pages. This is where the entire hassle comes in, mastering these frameworks, and being able to use them for your fundamental development patterns.&lt;/p&gt;

&lt;p&gt;Now, there is an adage that goes &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Jack of all trades, but a master of none. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This may or may not be true, considering the entire need for the use of these frameworks. The main thing is moderation. You need to know what you need to use to achieve what you want to achieve; this means that you should be able to understand whichever method you are using and understand how to make maximum use of it to bring interactivity to the users.&lt;/p&gt;

&lt;h2&gt;
  
  
  The current state of front-end development.
&lt;/h2&gt;

&lt;p&gt;Now, there are a lot of ways frontend developers bring interactivity to the web, and how they incorporate it. It may include subtle but captivating animations, which enthral users, the effects that happen when you are on a particular item, or the arrangement of colours and placement of items on the screen. Fonts and typefaces also play a huge part in what affects users and how they use their websites. They are used to display a particular feel, and they play a huge part in how users would view a particular website, and what it entails.&lt;/p&gt;

&lt;p&gt;Front-end development remains what it always has been, providing an easy and understandable means for users to be able to understand and interact with whatever you have placed in store for them. For advanced cases, frontend development also entails the methods used to hold users captivated on their website, so they can generate more traction, and amass those &lt;code&gt;digital footprints&lt;/code&gt;. Some others, a minute other have decided that frontend development is a place to express their artistry to the maximum limits! They would use any methods, complex and others like it to ensure they are able to express themselves artistically in their works, and it elucidates their creative passions and what exactly they define as frontend development. This has made them stand out in their fields. Independent creatives like &lt;a href="https://aristidebenoist.com/"&gt;Aristide Benoist&lt;/a&gt;, whose work I admire is one of those whose finesse is always portrayed in whatever he does.&lt;/p&gt;

&lt;h2&gt;
  
  
  Frameworks and libraries for front-end development
&lt;/h2&gt;

&lt;p&gt;Initially, I intended this piece to just be my view on front-end development, and why it should be embraced as more than just something to jump into. But, to give more guidance to individuals who would need it, I will explain and give some resources to what I use in front-end development, that I find useful (you will not see ChatGPT).&lt;/p&gt;

&lt;p&gt;Now, to add a dynamic effect to webpages, you use JavaScript. Hence, all the frameworks and libraries I will be mentioning dwell on JavaScript. They have been developed over the years by developers who have seen the increasing demand for web interactivity and have provided means to work on this.&lt;/p&gt;

&lt;p&gt;Now, to start with some UI libraries I find intuitive for development, we have;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://www.framer.com/"&gt;Framer&lt;/a&gt;&lt;/strong&gt;: Now, Framer is not just a library, as it has evolved into a framework for building low-code/no-code interactive web pages. The part used by developers to incorporate interactivity in webpages is &lt;a href="https://www.framer.com/motion/"&gt;framer-motion&lt;/a&gt;. It is a very intuitive and easy-to-learn interface.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://uiverse.io/"&gt;UIverse&lt;/a&gt;&lt;/strong&gt;: this is a library where you can copy and incorporate any form of UI element animations into your website. The code is there and just requires you to copy and paste. It ranges from Form elements to social media buttons.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://bennettfeely.com/clippy/"&gt;Clippy&lt;/a&gt;&lt;/strong&gt;: For those who love to draw shapes. You can use this to generate shapes using the clip-path tool CSS provides, to be able to draw shapes. It is a very intuitive tool.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://animate.style/"&gt;Animate.css&lt;/a&gt;&lt;/strong&gt;: This is an intuitive library which allows you to add animations to your HTML elements without the need to write those long and boring CSS &lt;code&gt;keyframes&lt;/code&gt; rules to animate your element. It is attached to the class of your HTML element, and it works like magic.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://neumorphism.io"&gt;Neumorphism.io&lt;/a&gt;&lt;/strong&gt;: it is an intuitive design tool, which helps to provide the perfect box shadow element you need to create a neumorphic event for your webpage.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://favicon.io/"&gt;Favicon Generator&lt;/a&gt;&lt;/strong&gt;: If you have been searching for ways to be able to generate favicons for your project, this is a resourceful tool which would help you to convert those images to favicons for your use.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://fontjoy.com/"&gt;Font Joy&lt;/a&gt;&lt;/strong&gt;: have you been looking for the perfect font combinations for your website, this tool is very intuitive, as it generates font matches with the click of a button&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://coolors.co/"&gt;Coolors.co&lt;/a&gt;&lt;/strong&gt;: This website offers intuitive combinations of colours you could use for your next project. It is highly customizable and helps save time in looking for the perfect colour combinations for your project.&lt;/p&gt;

&lt;p&gt;I could go on listing all that I have in my arsenal which aids me in developing intuitive web pages, but, It would be a whole hassle. You can reach me if you need any guidance. Ever happy to help.&lt;/p&gt;

&lt;p&gt;Frameworks used in frontend development are vast, and each are good with its individual qualities. Some examples are; &lt;a href="https://remix.run"&gt;Remix.run&lt;/a&gt;, &lt;a href="https://svelte.dev/"&gt;Svelte&lt;/a&gt;, &lt;a href="https://angular.io/"&gt;Angular&lt;/a&gt;, &lt;a href="https://nextjs.org/"&gt;Next.js&lt;/a&gt;, &lt;a href="https://vuejs.org/"&gt;Vue.js&lt;/a&gt;. these are intuitive frameworks which can be used for frontend development and have heavy SEO optimization support.&lt;/p&gt;

&lt;p&gt;You can choose to learn one, two or all of them. What matters most is what you can use it to achieve. Cheers to your learning experience.&lt;/p&gt;

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

&lt;p&gt;To cap it up, frontend development is more than just aligning &lt;code&gt;divs&lt;/code&gt;, and rendering the appropriate colour, or translating a &lt;code&gt;figma&lt;/code&gt; design to interactive code. There is a lot that goes into fundamentally creating a website which would be able to portray yourself as a front-end developer, including accessibility for screen readers and those with aids to be able to navigate your application with ease. These are the fundamental parts that need to be embraced in front-end development.&lt;/p&gt;

&lt;p&gt;So, when next your friend wants to venture into front-end development, as they assume it is easy, quietly make them known to these facts and plausibility that surround the concept of frontend development and ensure they understand the nitty-gritty before getting their hands wet.&lt;/p&gt;

&lt;p&gt;You can send me &lt;a href="//mailto:cfaodigbo@gmail.com"&gt;mails&lt;/a&gt; to understand more, and I am active on &lt;a href="https://twitter.com/OdigboF"&gt;Twitter&lt;/a&gt; and &lt;a href="https://www.linkedin.com/in/franklin-odigbo-706886202/"&gt;LinkedIn&lt;/a&gt;.&lt;br&gt;
Check out my &lt;a href="https://chibuzo-franklin-portfolio.vercel.app/"&gt;website&lt;/a&gt; too.&lt;/p&gt;

&lt;p&gt;Ciao🍻&lt;/p&gt;

</description>
      <category>frontend</category>
      <category>webdev</category>
      <category>javascript</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Build a theme toggle with REACT-TS, TailwindCSS and ContextAPI</title>
      <dc:creator>Chibuzo Franklin Odigbo</dc:creator>
      <pubDate>Thu, 30 Nov 2023 13:05:16 +0000</pubDate>
      <link>https://dev.to/franklivania/build-a-theme-toggle-with-react-ts-tailwindcss-and-contextapi-2379</link>
      <guid>https://dev.to/franklivania/build-a-theme-toggle-with-react-ts-tailwindcss-and-contextapi-2379</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Writing this solution, is because I scoured the ends of the earth to find something that works, and using knowledge obtained from my research, and a &lt;a href="https://youtu.be/VylXkPy-MIc?si=UHlme4Q8wu75bdTQ"&gt;YouTube&lt;/a&gt; video I watched, I was able to achieve this effect, and I am making this available for us to draw insight from… may be;&lt;br&gt;
Well, we all know the drill, first things first, we prompt our app, using vite. So, here we go!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;PS&lt;/strong&gt;: &lt;em&gt;I’ll be using npm. For yarn or others, you can see the &lt;a href="https://vitejs.dev/guide/"&gt;Vite docs&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  &lt;em&gt;Let us begin&lt;/em&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu06svgxjge2trk96kzh1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu06svgxjge2trk96kzh1.png" alt="Initalize your application using Vite" width="800" height="307"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then, we install the proper dependencies as follows, look at the &lt;a href="https://tailwindcss.com/docs/guides/vite"&gt;Tailwind docs&lt;/a&gt; for more guidance&lt;br&gt;
As I am using the bash terminal, I am provided with some kind &lt;code&gt;linux&lt;/code&gt; flow, so, I do;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn1zibjo7a30eggd2qxmf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn1zibjo7a30eggd2qxmf.png" alt="Install tailwindCSS, postCSS and autoprefixer" width="800" height="247"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It would create it. So, your code panel would look like this;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ficfuyj3kemq3kabb1c1f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ficfuyj3kemq3kabb1c1f.png" alt="Inital file arrangement" width="359" height="569"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You will see we have our &lt;code&gt;postcss.config.js&lt;/code&gt; and &lt;code&gt;tailwind.config.js&lt;/code&gt; files ready for us.&lt;br&gt;
This is how the initial screen looks like&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnd2920a24aivcsi8qo3m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnd2920a24aivcsi8qo3m.png" alt="Initial React + Vite load view" width="800" height="387"&gt;&lt;/a&gt;&lt;br&gt;
Moving forward, as we are using Vite, we make some specific prompts which enable us to configure Tailwind properly for us to use. You will then add this to your tailwind.config.js&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/** @type {import('tailwindcss').Config} */
export default {
  content: [
    "./index.html",
    "./src/**/*.{js,ts,jsx,tsx}",
  ],
  theme: {
    extend: {},
  },
  plugins: [],
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then you add this to your index.css, after clearing it of everything;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@tailwind base;
@tailwind components;
@tailwind utilities;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your index.css should then look like this&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnt48fxro6masz5zi4chy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnt48fxro6masz5zi4chy.png" alt="index.css modification" width="800" height="520"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is the icon library I would be using, check it at &lt;a href="https://icon-sets.iconify.design/"&gt;Iconify&lt;/a&gt;. Then, I would install it as a dev dependency&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqu8kby5cygh7dso09uok.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqu8kby5cygh7dso09uok.png" alt="Installation of the Iconify Library" width="750" height="263"&gt;&lt;/a&gt;&lt;br&gt;
You should also clear all the stuff in your &lt;code&gt;App.css&lt;/code&gt;, and add the &lt;code&gt;initial css&lt;/code&gt; prompts to remove the default browser stylings. It should look like this&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flojqxt6gu0cb1ctna0bc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flojqxt6gu0cb1ctna0bc.png" alt="Look after removing the default stylings" width="800" height="390"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That is for the initial CSS stuff.&lt;/p&gt;
&lt;h2&gt;
  
  
  Initalizing your fonts
&lt;/h2&gt;

&lt;p&gt;It is time to cook our stuff. As a bonus, I would also be adding fonts to the project. The place where I get my fonts is &lt;a href="https://www.cdnfonts.com/"&gt;CDNFonts&lt;/a&gt;. It is a very prolific place, without the constraints of Google... Well, you know the drill.&lt;br&gt;
So, I’ll be using the &lt;a href="https://www.cdnfonts.com/varuna.font"&gt;Varuna&lt;/a&gt; font, copy and paste in your index.css, and make these modifications to your tailwind.config.js&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@import url('https://fonts.cdnfonts.com/css/varuna');
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When you do, you should have;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqsjz7sx2j8kog74efvb5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqsjz7sx2j8kog74efvb5.png" alt="How to import the font to css" width="800" height="573"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0r2pxfcgmw4z1n2ypi2z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0r2pxfcgmw4z1n2ypi2z.png" alt="How to sync it with TailwindCSS" width="800" height="652"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting Started with the Theme Changer
&lt;/h2&gt;

&lt;p&gt;In your &lt;code&gt;src&lt;/code&gt; folder, create a &lt;code&gt;context&lt;/code&gt; folder, and create a &lt;code&gt;ThemeContext.tsx&lt;/code&gt; file to it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgxh2ht8omwua18fld42w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgxh2ht8omwua18fld42w.png" alt="Folder arrangement for Theme changer" width="384" height="320"&gt;&lt;/a&gt;&lt;br&gt;
When you do, you should have a starter code like this&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgmmvbbx2o4ktnt34fuwg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgmmvbbx2o4ktnt34fuwg.png" alt="Inital code showing what to import from react with types to create" width="800" height="635"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You have created a &lt;code&gt;Theme&lt;/code&gt; type to store the types, then the interface to use those types to perform whatever function you would need. &lt;br&gt;
Then, create a &lt;code&gt;ThemeContext&lt;/code&gt; to store the states in a context&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9p0vazl2o5ws69y6av4w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9p0vazl2o5ws69y6av4w.png" alt="Theme Context code" width="800" height="144"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After that, create an arrow function, which would contain all the parameters you would need to execute the theme change. I will call it &lt;code&gt;ThemeProvider&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6olmac1eh4n7poo5av6k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6olmac1eh4n7poo5av6k.png" alt="ThemeProvider function code" width="800" height="227"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this &lt;code&gt;ThemeProvider&lt;/code&gt;, I would use the &lt;code&gt;useState&lt;/code&gt; hook to toggle the state based on which theme, then create a function to handle it’s toggle. The code should look like this&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcq43uy8yox2adfb01u1p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcq43uy8yox2adfb01u1p.png" alt="Initialising the useState for the code" width="800" height="345"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Merging those code together, we should have;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fob5hg6a00zcfz1pxm3h3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fob5hg6a00zcfz1pxm3h3.png" alt="Final code when you combine them" width="800" height="402"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We then create a function to be able to use the &lt;code&gt;Theme&lt;/code&gt;, and set an error boundary, so we would be able to know if there is an issue using it&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fne06b2ng1dbipbtzghgz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fne06b2ng1dbipbtzghgz.png" alt="Theme code with error boundary" width="800" height="442"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When you are done, you would write parameters to export the &lt;code&gt;ThemeProvider&lt;/code&gt; and the &lt;code&gt;useTheme&lt;/code&gt;. When that is done, you should have your full code like this…&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6tolv6qt3mc1yu4q1v0l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6tolv6qt3mc1yu4q1v0l.png" alt="The full code showing the way the function is to be" width="800" height="849"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, let us use it to toggle our theme. The colors I used, are generated from coolors.co[link], check it out. We would also initialize the &lt;code&gt;darkMode&lt;/code&gt; in tailwind.config.js, and add the class to the &lt;code&gt;index.html&lt;/code&gt;. Ensure it is written &lt;code&gt;className&lt;/code&gt;, not &lt;code&gt;class&lt;/code&gt;. You should have this;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwr2op8fxd7sqwmpmxq5t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwr2op8fxd7sqwmpmxq5t.png" alt="Initializing darkMode in the tailwind.config.js" width="800" height="850"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpuu7yzfn8h8swsdpolcn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpuu7yzfn8h8swsdpolcn.png" alt="HTML code showing the dark class" width="800" height="679"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Do not forget to wrap your &lt;code&gt;App&lt;/code&gt; in your &lt;code&gt;main.tsx&lt;/code&gt; with the &lt;code&gt;ThemeProvider&lt;/code&gt;.&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
Now, let us write the code to test the theme, and change it. I would be using the initial boilerplate code with the modifications to change the theme&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff52nw7d68yk0qaz73668.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff52nw7d68yk0qaz73668.png" alt="Initial CSS code showing stylings" width="800" height="1350"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With the stylings and all, you should have this;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9o44alu70wdh6n3zg440.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9o44alu70wdh6n3zg440.png" alt="Light theme" width="800" height="387"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F20eo2evcjr9ieh9ju3x7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F20eo2evcjr9ieh9ju3x7.png" alt="Dark theme" width="800" height="388"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Special:
&lt;/h2&gt;

&lt;p&gt;To make the theme persist reload, you have to save it to local storage. So, your code would be modified as such;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F89rskf53mfgzx46xjf9o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F89rskf53mfgzx46xjf9o.png" alt="Adding localStorage to code so it persists reload" width="800" height="515"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And that’s all folks. Hope you worked with this, and it potentially solved your problem.&lt;/p&gt;

&lt;p&gt;Catch you next time. Thank you!&lt;br&gt;
You can reach by mail here &lt;a href="//mailto:cfaodigbo@gmail.com"&gt;Chibuzo Odigbo&lt;/a&gt;, &lt;a href="https://twitter.com/OdigboF"&gt;Twitter&lt;/a&gt;, &lt;a href="https://www.linkedin.com/in/franklin-odigbo-706886202/"&gt;LinkedIn&lt;/a&gt;, &lt;a href="https://github.com/Franklivania"&gt;Github&lt;/a&gt;, &lt;a href="https://chibuzo-franklin-portfolio.vercel.app/"&gt;My Website&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Cheers🍻&lt;/p&gt;

</description>
      <category>tailwindcss</category>
      <category>react</category>
      <category>typescript</category>
      <category>contextapi</category>
    </item>
  </channel>
</rss>
