<?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: React Rainbow</title>
    <description>The latest articles on DEV Community by React Rainbow (@react-rainbow).</description>
    <link>https://dev.to/react-rainbow</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%2Forganization%2Fprofile_image%2F3634%2Fef31fe5f-811d-4842-b25d-dfee6560013a.jpg</url>
      <title>DEV Community: React Rainbow</title>
      <link>https://dev.to/react-rainbow</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/react-rainbow"/>
    <language>en</language>
    <item>
      <title>Our component development principals.</title>
      <dc:creator>Maxx Greene</dc:creator>
      <pubDate>Thu, 28 Jan 2021 18:18:33 +0000</pubDate>
      <link>https://dev.to/react-rainbow/our-component-development-principals-h8d</link>
      <guid>https://dev.to/react-rainbow/our-component-development-principals-h8d</guid>
      <description>&lt;p&gt;Building a component library it’s not an easy task, notably when it fulfills the purpose of being used by multiple projects and requirements are continually changing. Given these challenges, we have a set of principles that guide us through the process of creating reliable components.‌&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;API design is foundational:&lt;/strong&gt; We take this field seriously.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Don’t start writing any code until the specification document is done and evaluated by the team.&lt;/li&gt;
&lt;li&gt;Design from restricted API then relax based on valid use cases.&lt;/li&gt;
&lt;li&gt;Create a deterministic API that doesn’t allow you to do the same thing in two different ways.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Defer it as long as possible. The best way of reducing the impact of breaking changes is to avoid them in the first place.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Until you have the information necessary, you are just guessing at what is needed and your success is determined largely by luck. I also believe you may be grossly underestimating the costs of speculation. — &lt;a href="https://wiki.c2.com/?WayneMack"&gt;WayneMack&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Generalization process is the key to avoid breaking changes. Avoid generalizing your component too early but keep in mind that the new API shouldn’t compromise generalize when new use cases arrive. I wrote more about this interesting topic &lt;a href="https://medium.com/react-rainbow/generalization-process-applied-to-api-design-of-ui-components-88b68421792c"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;First-class Testing&lt;/strong&gt;: Our components are test infected. There isn’t software improvement without refactoring and there isn’t refactoring without tests.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Internationalization&lt;/strong&gt;: We design each component with &lt;a href="https://en.wikipedia.org/wiki/Internationalization_and_localization"&gt;i18n&lt;/a&gt; in mind. Any new component or feature has to be able to work fully in different locales.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;&lt;a href="https://react-rainbow.io/"&gt;react-rainbow-components&lt;/a&gt; wouldn’t be possible without the support of engineers from around the world. Thus, building a component library with internationalization is a requirement, not a nice to have.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Accessibility&lt;/strong&gt;: It’s part of our definition of done. It’s a must-have for each component.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Documentation&lt;/strong&gt;: It’s critical to the success of any project. There is no adoption without good documentation.&lt;/p&gt;

&lt;p&gt;I know you have your own set of principles, let us know if ours make sense to you, we are eager to learn from you. Comment below.&lt;/p&gt;

</description>
      <category>components</category>
      <category>library</category>
      <category>react</category>
      <category>programming</category>
    </item>
    <item>
      <title>Generalization Process applied to API design of UI components.
</title>
      <dc:creator>Maxx Greene</dc:creator>
      <pubDate>Thu, 28 Jan 2021 18:05:31 +0000</pubDate>
      <link>https://dev.to/react-rainbow/generalization-process-applied-to-api-design-of-ui-components-6hc</link>
      <guid>https://dev.to/react-rainbow/generalization-process-applied-to-api-design-of-ui-components-6hc</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;To make a piece of machinery “more general” you have to modify it to be capable of doing something other than what it already does, while making sure it can still do what it does now.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  What is Generation Process?
&lt;/h3&gt;

&lt;p&gt;If you search on Google about “Generation Process” one of the first results returned — at least for my Google profile :) — would be the Wikipedia &lt;a href="https://en.wikipedia.org/wiki/Generalization" rel="noopener noreferrer"&gt;definition&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Basically, the definition describes that given two related concepts A and B, A is a “generalization” of B (equivalent, B is a &lt;a href="https://en.wikipedia.org/wiki/Special_case" rel="noopener noreferrer"&gt;special case&lt;/a&gt; of A) if and only if both of the following hold:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Every instance of concept B is also an instance of concept A.&lt;/li&gt;
&lt;li&gt;There are instances of concept A which are not instances of concept B.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The concept might have a more specific meaning in a specialized context(e.g. generalization in learning, generalization in programming).&lt;/p&gt;

&lt;h3&gt;
  
  
  Generalization in programming
&lt;/h3&gt;

&lt;p&gt;In my early days doing programming with Delphi and later with Java everything was about Object-Oriented Programming(OOP). Back then we read &lt;a href="https://www.amazon.com/Object-Oriented-Analysis-Design-Applications-3rd/dp/020189551X" rel="noopener noreferrer"&gt;Object-oriented analysis and design with applications&lt;/a&gt; and Generalization was tight in our mental model to Inheritance.&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%2Fi%2Fmpteivbeac10bm1xs3b4.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%2Fi%2Fmpteivbeac10bm1xs3b4.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The concept of &lt;strong&gt;Animal&lt;/strong&gt; is a generalization of the concept of &lt;strong&gt;Dog&lt;/strong&gt; since every dog is an animal but not every animal is a dog(a cat, for instance).&lt;/p&gt;

&lt;p&gt;Here some other examples of Generalization in programming:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Abstract Classes&lt;/strong&gt;. Abstract classes isolate the common characteristics of their descendants.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Templates&lt;/strong&gt;. Templates allow functions and classes to be parameterized by type.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Libraries&lt;/strong&gt;. Placing a piece of code in a library allows it to be used by more than one program.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  How we applied it to UI components API design?
&lt;/h3&gt;

&lt;p&gt;A UI component implementation by itself is a Generalization of all the use cases that support when you build it to be reusable in more than one use case or in more than one application. But how is Generation related to API design?&lt;/p&gt;

&lt;p&gt;When designing a component API you should defer implementing features as long as possible to avoid making guesses.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Until you have the information necessary, you are just guessing at what is needed and your success is determined largely by luck. I also believe you may be grossly underestimating the costs of speculation. &lt;a href="https://wiki.c2.com/?WayneMack" rel="noopener noreferrer"&gt;WayneMack&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;At some point, you can’t defer anymore a new feature for a component, it’s clear that this feature belongs to component A, then one of the first question to ask ourself is, how the new version of the API won’t compromise the previous use cases.&lt;/p&gt;

&lt;p&gt;In other words, if every use case of your component is a special case of your component API, the new API must not conflict with the previous use cases or that will be considered a breaking change or a violation of the generalization process.&lt;/p&gt;

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

&lt;p&gt;There isn't a single receipt for always apply the generalization process on API design. I always try to exercise &lt;em&gt;generalization&lt;/em&gt; with the future API of the component by asking: how the new API won’t compromise other use cases we might want to implement in the future?&lt;/p&gt;

&lt;p&gt;Ultimately we need to be fine with designs we agreed on, they could be designed to not support certain use cases.&lt;/p&gt;

</description>
      <category>api</category>
      <category>programming</category>
      <category>design</category>
      <category>components</category>
    </item>
    <item>
      <title>Implementing an Image Gallery using a React Library and Firebase</title>
      <dc:creator>Andy Montalvo</dc:creator>
      <pubDate>Thu, 28 Jan 2021 04:30:31 +0000</pubDate>
      <link>https://dev.to/react-rainbow/implementing-an-image-gallery-using-a-react-library-and-firebase-39h5</link>
      <guid>https://dev.to/react-rainbow/implementing-an-image-gallery-using-a-react-library-and-firebase-39h5</guid>
      <description>&lt;p&gt;If you’d prefer to watch rather than read: &lt;a href="https://youtu.be/bG7tIR4QS10" rel="noopener noreferrer"&gt;https://youtu.be/bG7tIR4QS10&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Galleries are a popular way of integrating images into a web application. Image galleries let you add photos in rows and columns, allowing you to display more photos in less space while also making it easier for users to browse them.&lt;/p&gt;

&lt;p&gt;In this article I will show you how to how to use an Image Gallery in a faster, easiest way, using React &lt;a href="https://rainbow-modules.web.app/" rel="noopener noreferrer"&gt;rainbow-modules&lt;/a&gt; library and Firebase. To accomplish this, you must have a general background in Javascript, React, Node.js, and Yarn.&lt;/p&gt;

&lt;h1&gt;
  
  
  What you will need
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Node.js&lt;/li&gt;
&lt;li&gt;Yarn&lt;/li&gt;
&lt;li&gt;Your favorite IDE (I will use VSCode)&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Add dependencies
&lt;/h1&gt;

&lt;p&gt;For this project, I will use a new create-react-app project. If you want to know more and how to initialize a project, see: &lt;a href="https://create-react-app.dev/" rel="noopener noreferrer"&gt;https://create-react-app.dev/&lt;/a&gt;.&lt;br&gt;
After creating the project we proceed to the installation of the necessary dependencies.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;yarn add react-intl react-redux react-router-dom redux redux-form
yarn add @rainbow-modules/app
yarn add @rainbow-modules/storage
yarn add react-rainbow-components
yarn add firebase
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After installing the dependencies we are ready to code!&lt;/p&gt;

&lt;h1&gt;
  
  
  Coding
&lt;/h1&gt;

&lt;p&gt;First of all, we should use the correct configuration to connect a Firebase project with our React application. Create a file named firebase.js inside the src folder where we will save the Firebase project configuration.&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="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;firebase&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;firebase/app&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;firebase/storage&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;firebaseConfig&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;apiKey&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;your apiKey&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;authDomain&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;your authDomain&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;projectId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;your projectId&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;storageBucket&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;your storageBucket&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;messagingSenderId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;your messagingSenderId&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;appId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;your appId&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="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;firebase&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;initializeApp&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;firebaseConfig&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now that we have our configuration ready, we go to App.js and delete all its content. Now we import the dependencies into it.&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="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;RainbowFirebaseApp&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="s1"&gt;@rainbow-modules/app&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&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;ImageGallery&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="s1"&gt;@rainbow-modules/storage&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&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;Card&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="s1"&gt;react-rainbow-components&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;firebaseApp&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./firebase&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./App.css&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, let’s add the following code in the App component:&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="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;App&lt;/span&gt;&lt;span class="p"&gt;()&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="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;RainbowFirebaseApp&lt;/span&gt; &lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;firebaseApp&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;App&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
                &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Card&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
                    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;ImageGallery&lt;/span&gt;
                        &lt;span class="nx"&gt;path&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/gallery&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
                        &lt;span class="nx"&gt;allowUpload&lt;/span&gt;
                        &lt;span class="nx"&gt;allowDelete&lt;/span&gt;
                        &lt;span class="nx"&gt;onSelect&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{(&lt;/span&gt;&lt;span class="nx"&gt;imageRef&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="nf"&gt;alert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;imageRef&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                        &lt;span class="p"&gt;}}&lt;/span&gt;
                    &lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;                &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/Card&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;            &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/RainbowFirebaseApp&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&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="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;App&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With these few lines of code, we already have an image gallery working in our application. As we can see we must add a &lt;code&gt;path&lt;/code&gt; prop with the path in the firebase storage where the images will be saved for the gallery to work.&lt;/p&gt;

&lt;p&gt;Notice that the &lt;code&gt;allowUpload&lt;/code&gt; and &lt;code&gt;allowDelete&lt;/code&gt; props enable and disable the image Upload and Delete options. And with the &lt;code&gt;onSelect&lt;/code&gt; prop we can execute some actions when a specific image is selected.&lt;/p&gt;

&lt;h1&gt;
  
  
  Styling
&lt;/h1&gt;

&lt;p&gt;We will also add some simple styles to enhance the web application appearance. Go to the App.css file and remove all its content, and inside it, add the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.App&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="nl"&gt;min-height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100vh&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
   &lt;span class="nl"&gt;text-align&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
   &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;flex&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
   &lt;span class="nl"&gt;flex-direction&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;column&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
   &lt;span class="nl"&gt;align-items&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
   &lt;span class="nl"&gt;justify-content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&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;Now we save and reload, and we should see something like 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%2Fres.cloudinary.com%2Fa03m02f92%2Fimage%2Fupload%2Fv1611808110%2FDevTo%2FScreen_Shot_2021-01-17_at_21.40.37_vai7kq.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%2Fres.cloudinary.com%2Fa03m02f92%2Fimage%2Fupload%2Fv1611808110%2FDevTo%2FScreen_Shot_2021-01-17_at_21.40.37_vai7kq.png" alt="Rainbow Image Gallery"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;We have reached the end of our journey, and as a result, we have a very attractive image gallery, ready to use in any React application with a few lines of code.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>react</category>
      <category>firebase</category>
      <category>imagegallery</category>
    </item>
    <item>
      <title>Using a React Table with Client-Side Pagination</title>
      <dc:creator>LeandroTorresSicilia</dc:creator>
      <pubDate>Thu, 28 Jan 2021 03:47:57 +0000</pubDate>
      <link>https://dev.to/react-rainbow/using-a-react-table-with-client-side-pagination-1hk4</link>
      <guid>https://dev.to/react-rainbow/using-a-react-table-with-client-side-pagination-1hk4</guid>
      <description>&lt;p&gt;If you’d prefer to watch rather than read:&lt;br&gt;
&lt;a href="https://youtu.be/v9E7moqUJ40" rel="noopener noreferrer"&gt;https://youtu.be/v9E7moqUJ40&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Pagination is a simple navigation technique that allows you to divide content into pages. It is very useful when you want to display a large recordset on multiple pages, for example in a table with a huge amount of data.&lt;/p&gt;

&lt;p&gt;In this article, I’ll be teaching you how to use a React Table with client-side pagination using &lt;a href="https://react-rainbow.io/" rel="noopener noreferrer"&gt;react-rainbow-components&lt;/a&gt;. To accomplish this tutorial, you must have a general background in React, Node.js, and Yarn.&lt;/p&gt;

&lt;h2&gt;
  
  
  Project setup
&lt;/h2&gt;

&lt;h3&gt;
  
  
  What you will need:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Node.js&lt;/li&gt;
&lt;li&gt;Yarn&lt;/li&gt;
&lt;li&gt;Your favorite IDE (For this tutorial, I will use VSCode)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Add dependencies
&lt;/h3&gt;

&lt;p&gt;For this project, I will use a new create-react-app project. If you want to know more and how to initialize a project, see: &lt;a href="https://create-react-app.dev/" rel="noopener noreferrer"&gt;https://create-react-app.dev/&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Once in the root of your project, let’s install react-rainbow-components and react-query:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

$ yarn add react-rainbow-components react-query


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

&lt;/div&gt;

&lt;p&gt;Once you have your new app with all dependencies installed, we should be ready to code!&lt;/p&gt;

&lt;h2&gt;
  
  
  Coding
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Importing dependencies
&lt;/h3&gt;

&lt;p&gt;Now we will start by importing react-query and react-rainbow-components:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;QueryClient&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;QueryClientProvider&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;useQuery&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="s1"&gt;react-query&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&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;Table&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;Column&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="s1"&gt;react-rainbow-components&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./App.css&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;


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

&lt;/div&gt;
&lt;h3&gt;
  
  
  Creating the service
&lt;/h3&gt;

&lt;p&gt;Create a function that fetches a list with all the countries:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;API_URL&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://sampleapis.com/countries/api/countries&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;fetchCountries&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async &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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;API_URL&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&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;I am using a free API that will return a list with certain information about the countries like name, capital, population, currency, and more.&lt;/p&gt;

&lt;h3&gt;
  
  
  Countries Component
&lt;/h3&gt;

&lt;p&gt;Now let’s add a Countries component that will render a Table with all the countries returned by the API call:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;Countries&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;isLoading&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useQuery&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;countries&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nx"&gt;fetchCountries&lt;/span&gt;&lt;span class="p"&gt;,&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="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Table&lt;/span&gt;
            &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;countries-table&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
            &lt;span class="nx"&gt;keyField&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;name&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
            &lt;span class="nx"&gt;isLoading&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;isLoading&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
            &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
            &lt;span class="nx"&gt;variant&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;listview&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
        &lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Column&lt;/span&gt; &lt;span class="nx"&gt;header&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Name&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;field&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;name&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
            &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Column&lt;/span&gt; &lt;span class="nx"&gt;header&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Capital&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;field&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;capital&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
            &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Column&lt;/span&gt; &lt;span class="nx"&gt;header&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Population&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;field&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;population&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
            &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Column&lt;/span&gt; &lt;span class="nx"&gt;header&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Currency&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;field&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;currency&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/Table&lt;/span&gt;&lt;span class="err"&gt;&amp;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;To make the call to the API, I used useQuery hook from the react-query package (&lt;a href="https://github.com/tannerlinsley/react-query" rel="noopener noreferrer"&gt;https://github.com/tannerlinsley/react-query&lt;/a&gt;). This hook will manage the fetch for us and return an object with data, isLoading, error, and more. Thus, we avoid the need to maintain the different states of the fetch process. Also, it provides other advantages like caching, updating out-of-date data in the background, performance optimizations, and many more. If you want to know more about react-query visit its documentation &lt;a href="https://react-query.tanstack.com/overview" rel="noopener noreferrer"&gt;https://react-query.tanstack.com/overview&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The react-rainbow-components Table needs a keyField prop which is required, it can be any field in the data that is unique like an id or a key representing the document or the row in the database. In this case, I used the country name which is unique. The Table also receives an isLoading that will render the loading state when it is true and data that is an array of objects with the data to show in the table. The columns are represented as children of the Table, and they receive a header that is a simple string that will show in the column header. Also, receive a field that represents the key in the data that its value will be shown in the column.&lt;/p&gt;

&lt;h3&gt;
  
  
  App Component
&lt;/h3&gt;

&lt;p&gt;Next, we will add an app component that is exported and it only has the QueryClientProvider wrapper around the Countries component.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;queryClient&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;QueryClient&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;App&lt;/span&gt;&lt;span class="p"&gt;()&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="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;QueryClientProvider&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;queryClient&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Countries&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/QueryClientProvider&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&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="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;App&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;


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

&lt;/div&gt;

&lt;p&gt;The QueryClient is used to interact with the cache managed by react-query. By wrapping your application with the QueryClientProvider you can access the QueryClient anywhere in the app.&lt;/p&gt;

&lt;h3&gt;
  
  
  Styling
&lt;/h3&gt;

&lt;p&gt;Now we will add some simple styles to the Table component:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;

&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;countries&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;table&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;40&lt;/span&gt;&lt;span class="nx"&gt;px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nx"&gt;background&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;rgb&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;244&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;246&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;249&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nl"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nx"&gt;min&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="nx"&gt;vh&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;When save and reload the page you will see something like:&lt;br&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%2Fi%2Fplcv891njwn3b1eubmp3.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%2Fi%2Fplcv891njwn3b1eubmp3.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can see it and play in this &lt;a href="https://codesandbox.io/s/elated-lederberg-zpo4q?file=/src/App.js" rel="noopener noreferrer"&gt;sandbox&lt;/a&gt;:&lt;/p&gt;

&lt;h3&gt;
  
  
  Problems with this solution
&lt;/h3&gt;

&lt;p&gt;Now we have a large table that shows all countries, but this can cause performance issues since we are rendering too many rows on the page, and creating such an amount of DOM elements is costly.&lt;br&gt;
How to solve this? Here is when client-side pagination comes into play. If your collection or table does not have too many records (hundreds or a few thousand), then you can fetch all of them and do client-side pagination as we will do next.&lt;/p&gt;

&lt;h3&gt;
  
  
  Client-Side pagination
&lt;/h3&gt;

&lt;p&gt;To achieve the client-side pagination, we can use the TableWithBrowserPagination component from the react-rainbow-components library. The only thing you need to do is import it and pass the &lt;code&gt;pageSize&lt;/code&gt; prop with the number of records you want to show per page.&lt;/p&gt;

&lt;p&gt;Replace the react-rainbow-components Table import line to:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;TableWithBrowserPagination&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;Column&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="s1"&gt;react-rainbow-components&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;


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

&lt;/div&gt;

&lt;p&gt;Here we only change &lt;code&gt;Table&lt;/code&gt; for &lt;code&gt;TableWithBrowserPagination&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Next, change the Countries component to use the TableWithBrowserPagination:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;Countries&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;params&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;isLoading&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useQuery&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;countries&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nx"&gt;fetchCountries&lt;/span&gt;&lt;span class="p"&gt;,&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="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;TableWithBrowserPagination&lt;/span&gt;
            &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;countries-table&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
            &lt;span class="nx"&gt;keyField&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;name&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
            &lt;span class="nx"&gt;isLoading&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;isLoading&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
            &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
            &lt;span class="nx"&gt;variant&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;listview&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
            &lt;span class="nx"&gt;pageSize&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;15&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Column&lt;/span&gt; &lt;span class="nx"&gt;header&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Name&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;field&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;name&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
            &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Column&lt;/span&gt; &lt;span class="nx"&gt;header&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Capital&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;field&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;capital&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
            &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Column&lt;/span&gt; &lt;span class="nx"&gt;header&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Population&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;field&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;population&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
            &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Column&lt;/span&gt; &lt;span class="nx"&gt;header&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Currency&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;field&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;currency&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/TableWithBrowserPagination&lt;/span&gt;&lt;span class="err"&gt;&amp;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;There were two simple changes in this code. First, we change Table for TableWithBrowserPagination and add a new prop pageSize with the value of 15, which means that it will render only 15 rows per page.&lt;/p&gt;

&lt;p&gt;Now we have:&lt;br&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%2Fi%2Ftzpgdublfxstg8xynt0m.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%2Fi%2Ftzpgdublfxstg8xynt0m.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As you can see, there is pagination at the bottom of the page. Now you can move through the different pages. All the data is already loaded, but we only render 15 rows per page. In this way, we avoid the performance issues caused by creating too many DOM elements.&lt;/p&gt;

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

&lt;p&gt;That’s all folks!&lt;/p&gt;

&lt;p&gt;Only with a few lines of code, we have used a table with client-side pagination. The main takeaway is that we can achieve a good user experience by simply splitting the data into pages. Not only does it solve the performance issue, but it also gives us a nice way to represent data since showing a table with a large scroll bar can be annoying to the user.&lt;/p&gt;

&lt;p&gt;Thanks for reading!&lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>programming</category>
      <category>components</category>
    </item>
    <item>
      <title>Adding a “DayNight” theme to your app with react-rainbow-components.</title>
      <dc:creator>Tahimi</dc:creator>
      <pubDate>Thu, 28 Jan 2021 01:13:38 +0000</pubDate>
      <link>https://dev.to/react-rainbow/adding-a-daynight-theme-to-your-app-with-react-rainbow-components-1pf4</link>
      <guid>https://dev.to/react-rainbow/adding-a-daynight-theme-to-your-app-with-react-rainbow-components-1pf4</guid>
      <description>&lt;p&gt;If you’d prefer to watch rather than read:&lt;br&gt;
&lt;a href="https://youtu.be/Dy0g3nLrFHE" rel="noopener noreferrer"&gt;https://youtu.be/Dy0g3nLrFHE&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Why Do We Need a DayNight theme?
&lt;/h3&gt;

&lt;p&gt;The DayNight functionality allows your app to easily switch between a dark ⬛ and light ⬜ theme. This has many benefits for your users, increasing usability for people with reduced-vision, and more.&lt;/p&gt;

&lt;p&gt;Dark theme reduces the light emitted by device screens while maintaining the minimum color contrast ratios required for readability. The advantages are, it enhances visual ergonomics by reducing eye strain, facilitating screens to adjust according to current light conditions, and providing the comfort of use at night or in dark environments.&lt;/p&gt;

&lt;p&gt;Through this article, I will show you how to implement a "DayNight" theme in your application using &lt;a href="https://react-rainbow.io/" rel="noopener noreferrer"&gt;react-rainbow-components&lt;/a&gt;. To accomplish this, you must have a general background in React, Node.js, and Yarn.&lt;/p&gt;
&lt;h2&gt;
  
  
  Project Settings
&lt;/h2&gt;
&lt;h3&gt;
  
  
  What you will need?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Node.js&lt;/li&gt;
&lt;li&gt;Yarn&lt;/li&gt;
&lt;li&gt;Your favorite IDE (For this tutorial, I will use VSCode)&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  Adding dependencies
&lt;/h3&gt;

&lt;p&gt;For this project, I will use a new &lt;code&gt;create-react-app project&lt;/code&gt;. If you want to know more and how to initialize a project, see: &lt;a href="https://create-react-app.dev/" rel="noopener noreferrer"&gt;https://create-react-app.dev/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For the app styles, I will use &lt;code&gt;styled-components&lt;/code&gt;. I like it because I can write styles with normal CSS syntax while having all the JS power. Once at the root of your project, let's install styled-components. For more information, see &lt;a href="https://styled-components.com/" rel="noopener noreferrer"&gt;https://styled-components.com/&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ yarn add styled-components@4.4.1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, let's install react-rainbow-components. For more information, see &lt;a href="https://react-rainbow.io/#/GettingStarted" rel="noopener noreferrer"&gt;https://react-rainbow.io/#/GettingStarted&lt;/a&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ yarn add react-rainbow-components
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once you have your new project with all dependencies installed, we should be ready to code!&lt;/p&gt;

&lt;h2&gt;
  
  
  Coding
&lt;/h2&gt;

&lt;h3&gt;
  
  
  The Skeleton
&lt;/h3&gt;

&lt;p&gt;Now we will begin to build the markup of our application. It consists of a single page that has a sidebar on the left, a group of Tiles on the top, and a list of data.&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="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Sidebar&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;SidebarItem&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;Card&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;Table&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;Column&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="s1"&gt;react-rainbow-components&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;App&lt;/span&gt;&lt;span class="p"&gt;()&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="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;main&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
                &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Sidebar&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
                    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;SidebarItem&lt;/span&gt; &lt;span class="nx"&gt;label&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Apps&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
                    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;SidebarItem&lt;/span&gt; &lt;span class="nx"&gt;label&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Chat&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
                    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;SidebarItem&lt;/span&gt; &lt;span class="nx"&gt;label&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Settings&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
                &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/Sidebar&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;                &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;section&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
                    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;header&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
                        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;h1&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Title&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/h1&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;                    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/header&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;                    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;section&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
                        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Card&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
                        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Card&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
                        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Card&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
                        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Card&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
                    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/section&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;                    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Table&lt;/span&gt;
                        &lt;span class="nx"&gt;keyField&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;id&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
                        &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
                        &lt;span class="nx"&gt;variant&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;listview&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
                    &lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
                        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Column&lt;/span&gt; &lt;span class="nx"&gt;header&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Name&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;field&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;name&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
                        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Column&lt;/span&gt; &lt;span class="nx"&gt;header&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Id&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;  &lt;span class="nx"&gt;field&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;id&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
                        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Column&lt;/span&gt; &lt;span class="nx"&gt;header&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Phone&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;field&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;phone&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
                        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Column&lt;/span&gt; &lt;span class="nx"&gt;header&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Status&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;  &lt;span class="nx"&gt;field&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;status&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
                    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/Table&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;                 &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/section&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;             &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/main&lt;/span&gt;&lt;span class="err"&gt;&amp;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;h3&gt;
  
  
  The Application component
&lt;/h3&gt;

&lt;p&gt;Now we will customize the default styles of our application. Since we are using &lt;code&gt;react-rainbow-components&lt;/code&gt; we will do this customization through the theme prop of the &lt;code&gt;Application&lt;/code&gt; component, which must wrap your entire app.&lt;/p&gt;

&lt;p&gt;The property &lt;code&gt;theme&lt;/code&gt; will accept an object where you can specify your palette of colors. If you want to see all the properties you can customize with the theme object, see: &lt;a href="https://react-rainbow.io/#/Customization" rel="noopener noreferrer"&gt;https://react-rainbow.io/#/Customization&lt;/a&gt;.&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="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;App&lt;/span&gt;&lt;span class="p"&gt;()&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="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Application&lt;/span&gt; &lt;span class="nx"&gt;theme&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;themes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;light&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="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/Application&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create the themes object:&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;themes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;light&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;rainbow&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="na"&gt;palette&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="na"&gt;brand&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#4dc9cb&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="na"&gt;success&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#98D38C&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="na"&gt;warning&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#F7DB62&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="na"&gt;error&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#f2707a&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;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;h3&gt;
  
  
  How style your tags?
&lt;/h3&gt;

&lt;p&gt;In order to use the theme with your custom components or tags, you can use styled-components normally as you would do in other projects, and out of the box, the props will have the theme object with all the custom colors.&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="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;styled&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;styled-components&lt;/span&gt;&lt;span class="dl"&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;Container&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;styled&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;main&lt;/span&gt;&lt;span class="s2"&gt;`
    background: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;theme&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;rainbow&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;palette&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;background&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;secondary&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;;
    height: 100vh;
`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The page will look like this:&lt;br&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%2Fi%2F27jgjfnwidzexj3b519a.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%2Fi%2F27jgjfnwidzexj3b519a.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  The DayNight theme colors
&lt;/h3&gt;

&lt;p&gt;Now we add the dark colors to the &lt;code&gt;themes&lt;/code&gt; object:&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;themes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;light&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;rainbow&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="na"&gt;palette&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="na"&gt;brand&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#4dc9cb&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="na"&gt;success&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#98D38C&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="na"&gt;warning&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#F7DB62&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="na"&gt;error&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#f2707a&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;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="na"&gt;dark&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;rainbow&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="na"&gt;palette&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="na"&gt;mainBackground&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#212121&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="na"&gt;brand&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#4dc9cb&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="na"&gt;success&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#98D38C&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="na"&gt;warning&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#F7DB62&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="na"&gt;error&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#f2707a&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;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;h3&gt;
  
  
  The DayNight switch button
&lt;/h3&gt;

&lt;p&gt;Next, we will implement the DayNight switch button functionality, so the user can change the theme of the application. We will use the local storage to keep the selected theme, even when the browser tab is closed or refreshed.&lt;/p&gt;

&lt;h4&gt;
  
  
  Implement the &lt;code&gt;useLocalTheme&lt;/code&gt; hook
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;useLocalTheme&lt;/span&gt; &lt;span class="o"&gt;=&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="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setState&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;localStorage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getItem&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;theme&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;light&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;setItem&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;value&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="nx"&gt;localStorage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setItem&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;theme&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="nf"&gt;setState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;);&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="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setItem&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;With this hook, we encapsulated the logic to interact with the local storage and also used a useState to make the dark/light theme switching reactive. It will return an array with two elements. The first is the state with a string indicating the selected theme, which will be initialized with the value stored in the local storage. If no value is found, then it will fallback to light. The second element is a function that will be used to store the new theme in the local storage and also will update the state to make the application react to the theme change.&lt;/p&gt;

&lt;h4&gt;
  
  
  Implementing the switch:
&lt;/h4&gt;

&lt;p&gt;Now we will use the useLocalTheme and add the onClick handler to the DayNight button:&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="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;App&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;theme&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setTheme&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useLocalTheme&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;switchIcon&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;theme&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;light&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;MoonIcon&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;SunIcon&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;toggleTheme&lt;/span&gt; &lt;span class="o"&gt;=&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="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;theme&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;light&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="nf"&gt;setTheme&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;dark&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="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nf"&gt;setTheme&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;light&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;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Application&lt;/span&gt; &lt;span class="nx"&gt;theme&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;themes&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;theme&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="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;ButtonIcon&lt;/span&gt;
                &lt;span class="nx"&gt;shaded&lt;/span&gt;
                &lt;span class="nx"&gt;variant&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;border-filled&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
                &lt;span class="nx"&gt;icon&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;switchIcon&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
                &lt;span class="nx"&gt;size&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;large&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
                &lt;span class="nx"&gt;onClick&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;toggleTheme&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;            &lt;span class="p"&gt;...&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here we added an icon that will render a moon or a sun based on the theme state. Also, we implemented the onClick handler called toggleTheme, which will make the theme switch using the function returned by the useLocalTheme hook.&lt;/p&gt;

&lt;p&gt;The page will look like this when the theme is dark:&lt;br&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%2Fi%2F0glhy55bgqes9mywzkr2.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%2Fi%2F0glhy55bgqes9mywzkr2.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can see the whole code and play in this sandbox:&lt;br&gt;
&lt;a href="https://codesandbox.io/s/sparkling-wave-rqzr7?file=/src/index.js" rel="noopener noreferrer"&gt;https://codesandbox.io/s/sparkling-wave-rqzr7?file=/src/index.js&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;As you can see, with those simple implementations, you can have a DayNight theme on your application.&lt;/p&gt;

&lt;p&gt;Thanks for reading!&lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>programming</category>
      <category>rainbow</category>
    </item>
    <item>
      <title>21 React YouTube Channels you should Follow </title>
      <dc:creator>YulyGP</dc:creator>
      <pubDate>Tue, 26 Jan 2021 23:49:30 +0000</pubDate>
      <link>https://dev.to/react-rainbow/21-react-youtube-channels-you-should-follow-al2</link>
      <guid>https://dev.to/react-rainbow/21-react-youtube-channels-you-should-follow-al2</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;It’s not necessary to know all the answers, but the channel of who may have it.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;As a child, I believed that older people knew all the answers in the world. So you can imagine my frustration when my questions were landing with an IDK answer from my parents or another family member. But one day, my dad gave me a piece of advice I will never forget: &lt;em&gt;You don’t have to know everything. Just have the phone number of those who may have the answers.&lt;/em&gt; And gave me the phone number of a library.&lt;/p&gt;

&lt;p&gt;I’m recalling this now when a new year is barely starting and I’ve been finding tons of comments about people beginning the journey with a new programming language.&lt;/p&gt;

&lt;p&gt;For those that are trying to keep up with React and Javascript and feeling exhausted, please don’t throw it the towel. Grab a cup of coffee (or tea, or a beer — I'm not judging), follow these 21 “phone numbers” (YouTube channels, you know what I mean), and play some videos. You will find what you’re looking for — from inspiration to education. Mastering is about persistence, patience, and have access to the right information. Just keep going!&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Fun Fun Function: &lt;a href="https://www.youtube.com/c/funfunfunction/featured"&gt;https://www.youtube.com/c/funfunfunction/featured&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Wes Bos: &lt;a href="https://www.youtube.com/user/wesbos/featured"&gt;https://www.youtube.com/user/wesbos/featured&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;FreeCodeCamp: &lt;a href="https://www.youtube.com/channel/UC8butISFwT-Wl7EV0hUK0BQ"&gt;https://www.youtube.com/channel/UC8butISFwT-Wl7EV0hUK0BQ&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Traversy Media: &lt;a href="https://www.youtube.com/user/TechGuyWeb"&gt;https://www.youtube.com/user/TechGuyWeb&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Academind: &lt;a href="https://www.youtube.com/channel/UCSJbGtTlrDami-tDGPUV9-w"&gt;https://www.youtube.com/channel/UCSJbGtTlrDami-tDGPUV9-w&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;The Net Ninja: &lt;a href="https://www.youtube.com/channel/UCW5YeuERMmlnqo4oq8vwUpg"&gt;https://www.youtube.com/channel/UCW5YeuERMmlnqo4oq8vwUpg&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Techsith: &lt;a href="https://www.youtube.com/user/techSithTube/featured"&gt;https://www.youtube.com/user/techSithTube/featured&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Pusher: &lt;a href="https://www.youtube.com/user/pusherapp/about"&gt;https://www.youtube.com/user/pusherapp/about&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;The Coding Train: &lt;a href="https://www.youtube.com/user/shiffman/featured"&gt;https://www.youtube.com/user/shiffman/featured&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Hitesh Choudhary: &lt;a href="https://www.youtube.com/user/hiteshitube/featured"&gt;https://www.youtube.com/user/hiteshitube/featured&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;LearnCode.academy: &lt;a href="http://www.youtube.com/user/learncodeacademy"&gt;http://www.youtube.com/user/learncodeacademy&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Dev Coffee: &lt;a href="https://www.youtube.com/channel/UCqr-7GDVTsdNBCeufvERYuw"&gt;https://www.youtube.com/channel/UCqr-7GDVTsdNBCeufvERYuw&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;ReactCasts: &lt;a href="https://www.youtube.com/channel/UCZkjWyyLvzWeoVWEpRemrDQ"&gt;https://www.youtube.com/channel/UCZkjWyyLvzWeoVWEpRemrDQ&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Facebook Developers: &lt;a href="https://www.youtube.com/user/FacebookDevelopers"&gt;https://www.youtube.com/user/FacebookDevelopers&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Rally Coding: &lt;a href="https://www.youtube.com/channel/UCQCaS3atWyNHEy5PkDXdpNg"&gt;https://www.youtube.com/channel/UCQCaS3atWyNHEy5PkDXdpNg&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Rem Zolotykh: &lt;a href="https://www.youtube.com/user/MrRemchi"&gt;https://www.youtube.com/user/MrRemchi&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Codevolution: &lt;a href="https://www.youtube.com/c/Codevolution"&gt;https://www.youtube.com/c/Codevolution&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ben Awad: &lt;a href="https://www.youtube.com/user/99baddawg"&gt;https://www.youtube.com/user/99baddawg&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Kent C. Dodds: &lt;a href="https://www.youtube.com/channel/UCz-BYvuntVRt_VpfR6FKXJw"&gt;https://www.youtube.com/channel/UCz-BYvuntVRt_VpfR6FKXJw&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Programming with Mosh: &lt;a href="https://www.youtube.com/user/programmingwithmosh"&gt;https://www.youtube.com/user/programmingwithmosh&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;NodersJS: &lt;a href="https://www.youtube.com/channel/UC7tUsO3S7424TMcgSCUOCow/"&gt;https://www.youtube.com/channel/UC7tUsO3S7424TMcgSCUOCow/&lt;/a&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Hope this will help you. Thanks for reading!&lt;/strong&gt; &lt;/p&gt;

</description>
      <category>react</category>
      <category>youtubechannels</category>
      <category>javascript</category>
      <category>beginners</category>
    </item>
    <item>
      <title>How to make a HOW-TO guide in a few steps</title>
      <dc:creator>YulyGP</dc:creator>
      <pubDate>Tue, 26 Jan 2021 23:06:33 +0000</pubDate>
      <link>https://dev.to/react-rainbow/how-to-make-a-how-to-guide-in-a-few-steps-3gll</link>
      <guid>https://dev.to/react-rainbow/how-to-make-a-how-to-guide-in-a-few-steps-3gll</guid>
      <description>&lt;p&gt;There are tons of great guides, tutorials, and how-to videos out there. So how do you make yours stand out? It seems difficult but not impossible. Take a look at this guide for making a HOW-TO that’ll attract readers and make them want to share your content.&lt;/p&gt;

&lt;h1&gt;
  
  
  STEP 1. Planning
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Pick a topic to write about:&lt;/strong&gt; Think about a problem you can fix or something you are interested in. Pick a topic that hasn’t been written about too often. Do your homework, do research.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Think about your target audience:&lt;/strong&gt; Before starting your HOW-TO you should have a specific audience in mind. According to the audience, you can determine the level of detail you’ll need to create it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Research about the process:&lt;/strong&gt; Find out how other people do what you want to do. Look online for existing tutorials about the topic and annotate all the steps you think you’ll need. Don’t forget to take notes of all the positive, cool things you notice so you can implement them into your own creation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Gather the materials you need:&lt;/strong&gt; For your tutorial, you’ll need to collect all the material and information that you want to include. For example, pictures, code snippets, graphs, links to other resources, etc.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  STEP 2. Building it
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Create a great title and add an interesting image:&lt;/strong&gt; Grabbing readers’ attention in the first few seconds is key. Choose a title that clearly describes what the tutorial is about and an attractive image to complement it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Begin with an Introduction:&lt;/strong&gt; Introduce the topic in a simple way so your audience clearly understands what you’re talking about, and why this topic will be useful.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Include a list of supplies, tools and/or resources:&lt;/strong&gt; Before you start to describe the process, you may want to list what the person will need to accomplish the task. Inform your audience about any required knowledge, configuration, or useful resources.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Write instructions in chronological order:&lt;/strong&gt; Follow a step-by-step approach, keeping in mind the logical sequence of events. Describe each step as clearly and precisely as possible. Use images, code snippets, graphs, short videos to help your readers conceptualize the process.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Conclude with tips, advice, links to other resources:&lt;/strong&gt; Lead your audience into other resources. Add tips, FAQs, references and all you think will help them to successfully make their task.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  STEP 3. Posting
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Check again what you create:&lt;/strong&gt; Be sure to check carefully for spelling and grammar mistakes. It may be helpful to have someone else review it. Ask for feedback.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Test the guide yourself:&lt;/strong&gt; Follow the step-by-step instructions you created. Look for an obvious step that you might have missed or a step out of order.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Publish your guide:&lt;/strong&gt; Once you have all the feedback and corrections, it’s time to publish it. You may want to put it on your website, blog, and/or in a publishing platform like Medium, that fits your intended audience. Check that your writing meets any specified guidelines of the site.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Don’t forget to keep an eye on your post reactions and comments. Feedback is always welcome and will help you improve not only what you have done, but also your future work.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I hope you find this guide useful. Notice you can also use it to create a tutorial video. Do you have a great HOW-TO tutorial you’d like to share? Post it in the comments below, and I’ll give you my opinion.&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>howto</category>
      <category>guidesandtutorials</category>
      <category>stepbystep</category>
    </item>
    <item>
      <title>11 Best Websites to Announce Software Products</title>
      <dc:creator>YulyGP</dc:creator>
      <pubDate>Tue, 22 Dec 2020 17:07:27 +0000</pubDate>
      <link>https://dev.to/react-rainbow/11-best-websites-to-announce-software-products-253e</link>
      <guid>https://dev.to/react-rainbow/11-best-websites-to-announce-software-products-253e</guid>
      <description>&lt;p&gt;2020 is coming to an end (Finally!), and I know you are waiting for the right moment to announce that idea you’ve been working on these last months. The start of a new year fits you like a glove. But &lt;em&gt;where&lt;/em&gt;?&lt;/p&gt;

&lt;p&gt;Internet could be overwhelming sometimes. There are many places to keep up to date and learn from people who are in the same field: LinkedIn, Facebook, Twitter, TikTok (why not?), YouTube, etc. For example, if you’re immersed in the tech environment, working in a &lt;strong&gt;SaaS&lt;/strong&gt; (Software as a Service) company, or even &lt;a href="https://medium.com/react-rainbow/21-react-youtube-channels-to-follow-before-2020-ends-3a5402297f6"&gt;learning a framework like React&lt;/a&gt;, YouTube is a good ally. But back to business, what you need is a list of the best websites to announce your software product for the first time. So here you have these &lt;strong&gt;11 websites&lt;/strong&gt; we’ve compiled for you, hoping these will help you put your ideas into the market and beyond:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Reddit- Entrepreneur: &lt;a href="https://www.reddit.com/r/Entrepreneur/"&gt;https://www.reddit.com/r/Entrepreneur/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Reddit-SideProject: &lt;a href="https://www.reddit.com/r/SideProject/"&gt;https://www.reddit.com/r/SideProject/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Hacker News: &lt;a href="https://news.ycombinator.com/"&gt;https://news.ycombinator.com/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Product Hunt: &lt;a href="https://www.producthunt.com/"&gt;https://www.producthunt.com/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Betalist: &lt;a href="https://betalist.com/"&gt;https://betalist.com/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;AngelList: &lt;a href="https://angel.co/"&gt;https://angel.co/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Beta Bound: &lt;a href="https://www.betabound.com/"&gt;https://www.betabound.com/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;BetaTesting: &lt;a href="https://betatesting.com/"&gt;https://betatesting.com/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Feed My App: &lt;a href="http://uk.feedmyapp.com/"&gt;http://uk.feedmyapp.com/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Index.co: &lt;a href="https://index.co/"&gt;https://index.co/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Launching Next: &lt;a href="https://www.launchingnext.com/"&gt;https://www.launchingnext.com/&lt;/a&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In case you don’t have a new software development project yet or are starting a new one right now, check out the &lt;a href="https://medium.com/react-rainbow/why-should-you-use-a-react-component-library-6c69b37ae109"&gt;benefits of doing it with a React component library&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Let me know your thoughts and which ones fit you. Good luck launching!&lt;/p&gt;

</description>
      <category>software</category>
      <category>saas</category>
      <category>marketing</category>
      <category>newproduct</category>
    </item>
    <item>
      <title>Should you build your own React component library?</title>
      <dc:creator>YulyGP</dc:creator>
      <pubDate>Wed, 18 Nov 2020 17:37:17 +0000</pubDate>
      <link>https://dev.to/react-rainbow/should-you-build-your-own-react-component-library-34l8</link>
      <guid>https://dev.to/react-rainbow/should-you-build-your-own-react-component-library-34l8</guid>
      <description>&lt;h4&gt;
  
  
  4 Advantages of Using a React Component Library, Three Musketeers and a D’Artagnan
&lt;/h4&gt;

&lt;p&gt;It seems that nowadays every software company is creating its own &lt;strong&gt;component libraries&lt;/strong&gt;. Why? Well, technology companies around the world have realized the only way to scale their software solution is by building reusable components.&lt;/p&gt;

&lt;p&gt;Most businesses have to develop multiple projects, and in doing so, usually need to follow the same design guidelines. By way of example, &lt;strong&gt;Google&lt;/strong&gt; offers several products such as Gmail, Google Docs, Google Analytics, and several others. You’ll notice that these projects all have similar user interfaces, that’s because Google leverages their own component library to cut down on development time and provide a consistent experience for their users across their applications.&lt;/p&gt;

&lt;p&gt;However, for smaller companies that lack the resources of Google, building a reusable &lt;strong&gt;UI component library&lt;/strong&gt; can be timely and cost prohibitive. Big companies are developing component libraries because they can afford to have what is called “platform teams” that support other developers inside the company by building things like component libraries so they can build software faster.&lt;/p&gt;

&lt;p&gt;So if you’re a small or medium-sized business or especially a new &lt;strong&gt;startup&lt;/strong&gt;, you’ll likely not have the resources available to build your own component library. Fortunately, there are several reliable and &lt;strong&gt;open source&lt;/strong&gt; component libraries that already exist and most importantly are free! By using an open source library, smaller companies are able to take full advantage of the benefits of utilizing a component library without worrying about the cost or time of building their own.&lt;/p&gt;

&lt;p&gt;To better understand the advantages of using an open source library let’s take a look at some key benefits of using them.&lt;/p&gt;

&lt;h3&gt;
  
  
  Benefits
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Ready To Use:&lt;/strong&gt; a component library is a robust set of ready-made UI components such as badges, buttons, tables, and so on. With a simple import, the library is ready to be used. Often, you just have to copy and paste code snippets to make it work.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Time Efficient:&lt;/strong&gt; you can mix and match the existing components to create your project so you can save time by not building everything from the beginning. It also reduces decision-making time from not having to design components APIs that work for all your use cases.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Developer Friendly:&lt;/strong&gt; components are carefully designed, well-documented, and well-organized by professionals. This will help you easily understand what you need to do, and shorten development and maintenance time. Plus if you’re a developer with not much design knowledge, you can effortlessly create elegant layouts and provide a nice UX for your users.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Consistency:&lt;/strong&gt; adopting a component library will give you a consistent UI and UX across your project. Meaning you don’t have to worry about your project having different designers working at the same time with inconsistent designs. Everything will remain uniform.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Not to mention, that since these libraries are open source they are &lt;strong&gt;free&lt;/strong&gt;! Meaning no need to get buy in or invest in leveraging these libraries.&lt;/p&gt;

&lt;h3&gt;
  
  
  How to evaluate component libraries
&lt;/h3&gt;

&lt;p&gt;Like any other tool, open-sourced component libraries aren’t perfect and it won’t suit every use case you may have.&lt;br&gt;
Based on my own experience, most of the gaps in open source component libraries are related to &lt;strong&gt;customization, accessibility, and testing&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;So you should consider the following while evaluating component libraries:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Does your project demand a lot of customization?&lt;/li&gt;
&lt;li&gt;Are you working on a government project that requires by law accessibility compliance?&lt;/li&gt;
&lt;li&gt;How well-tested are the components in the library you selected?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;While you analyze your project’s needs be sure to check out these top 3 component libraries, plus one that has been getting noticed lately by the community.&lt;/p&gt;

&lt;h3&gt;
  
  
  Three Musketeers on the market… and D’Artagnan
&lt;/h3&gt;

&lt;p&gt;If you decide that a component library is a good fit for your project, here are 3 of the most popular and useful React component libraries, frequently mentioned in tech blogs and platforms like &lt;a href="https://medium.com/"&gt;medium.com&lt;/a&gt; and &lt;a href="https://dev.to/"&gt;dev.to&lt;/a&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Material-UI&lt;/li&gt;
&lt;li&gt;Ant Design&lt;/li&gt;
&lt;li&gt;Semantic UI&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These libraries have a good reputation in the community and will help you build your React project with a great UI. They have tons of stars on GitHub, a bunch of high-quality components out of the box, flexibility in customizing components, as well as some other great features. They’re big, they’re good, and have been in the market for some time, but what about D’Artagnan?&lt;/p&gt;

&lt;p&gt;I strongly believe that we have to make room for new things, like when the old trio of musketeers accepted a new member in the iconic Alexandre Dumas’ novel. I believe, in this case, D’Artagnan is &lt;a href="https://www.rainbow-ui.com/"&gt;Rainbow UI&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Rainbow UI&lt;/strong&gt; is an open source React component library designed for enterprise-level products. Its features include internationalization, accessibility, and most importantly, they eliminate frustrating breaking changes.&lt;/p&gt;

&lt;p&gt;Rainbow UI offers over 90 components, which is more than Material, Semantic, and Ant Design. Providing you greater options and customization for your project.&lt;/p&gt;

&lt;p&gt;Rainbow UI also includes several modules and interactive examples so you can build a better product, faster. With the modules and interactive examples, this allows you to be ahead of the game in comparison to traditional options like our Three Musketeers listed above.&lt;/p&gt;

&lt;p&gt;For all my latest projects, we’ve used &lt;a href="https://github.com/nexxtway/react-rainbow"&gt;Rainbow UI&lt;/a&gt; and aren’t planning on switching back anytime soon. Ultimately, you can’t be wrong in any of the options listed above.&lt;/p&gt;

&lt;p&gt;Tell us in the comment section below what’s important while you’re evaluating component libraries and which library you typically utilize.&lt;/p&gt;

</description>
      <category>react</category>
      <category>library</category>
      <category>javascript</category>
      <category>typescript</category>
    </item>
  </channel>
</rss>
