<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Shiva Yadav]]></title><description><![CDATA[Web Developer | Freelancer]]></description><link>https://shivaydv.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Sat, 19 Sep 2026 17:24:28 GMT</lastBuildDate><atom:link href="https://shivaydv.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Toast Notifications in React.js with react-hot-toast]]></title><description><![CDATA[Introduction:
React.js has become a popular choice for building dynamic and interactive web applications. One essential aspect of user experience is providing feedback for actions, and toast notifications are a great way to accomplish this. In this b...]]></description><link>https://shivaydv.hashnode.dev/toast-notifications-in-reactjs-with-react-hot-toast</link><guid isPermaLink="true">https://shivaydv.hashnode.dev/toast-notifications-in-reactjs-with-react-hot-toast</guid><category><![CDATA[React]]></category><category><![CDATA[Web Development]]></category><category><![CDATA[Frontend Development]]></category><category><![CDATA[notifications]]></category><category><![CDATA[npm]]></category><dc:creator><![CDATA[Shiva Yadav]]></dc:creator><pubDate>Tue, 02 Jan 2024 11:13:00 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1704193351355/66e703b4-6ca9-4382-9e2c-ffcc8103c54b.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h3 id="heading-introduction">Introduction:</h3>
<p>React.js has become a popular choice for building dynamic and interactive web applications. One essential aspect of user experience is providing feedback for actions, and toast notifications are a great way to accomplish this. In this blog post, we'll explore how to integrate toast notifications in a React.js application using the <code>react-hot-toast</code> package.</p>
<h3 id="heading-what-is-react-hot-toast">What is react-hot-toast?</h3>
<p><code>react-hot-toast</code> is a lightweight and customizable toast notification library for React. It simplifies implementing notifications by providing a simple API and allowing for easy customization.</p>
<p><strong>Step 1: Installation</strong></p>
<p>To get started, you need to install the <code>react-hot-toast</code> package. Open your terminal and run the following command:</p>
<pre><code class="lang-bash">npm install react-hot-toast
</code></pre>
<p><strong>Step 2: Importing and Basic Usage</strong></p>
<p>Once the installation is complete, import the toast provider and use it in your application. Place <code>&lt;Toaster/&gt;</code> at the top of your application.</p>
<pre><code class="lang-javascript"><span class="hljs-comment">// Import necessary dependencies</span>
<span class="hljs-keyword">import</span> React <span class="hljs-keyword">from</span> <span class="hljs-string">'react'</span>;
<span class="hljs-keyword">import</span> { Toaster} <span class="hljs-keyword">from</span> <span class="hljs-string">'react-hot-toast'</span>;

<span class="hljs-comment">// Wrap your application with ToastProvider</span>
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">App</span>(<span class="hljs-params"></span>) </span>{
  <span class="hljs-keyword">return</span> (
    <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">Toaster</span>/&gt;</span></span>
      {<span class="hljs-comment">/* Your application components */</span>}
  );
}

<span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> App;
</code></pre>
<p><strong>Step 3: Displaying Toast Notifications</strong></p>
<p>Now that you have the <code>&lt;Toaster/&gt;</code> setup, you can easily display toast notifications by using the <code>toast</code> function provided by the package. Let's create a simple example:</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">import</span> React <span class="hljs-keyword">from</span> <span class="hljs-string">'react'</span>;
<span class="hljs-keyword">import</span> { toast} <span class="hljs-keyword">from</span> <span class="hljs-string">'react-hot-toast'</span>;

<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">MyComponent</span>(<span class="hljs-params"></span>) </span>{
   <span class="hljs-keyword">const</span> notify = <span class="hljs-function">() =&gt;</span> {
        toast.success(<span class="hljs-string">'Hello, this is a success notification!'</span>);
     };

  <span class="hljs-keyword">return</span> (
    <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">onClick</span>=<span class="hljs-string">{notify}</span>&gt;</span>Show Notification<span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span></span>
  );
}

<span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> MyComponent;
</code></pre>
<p>In this example, a success notification will be displayed using the method when the button is clicked. You can customize the notification type (success, error, loading, etc.) and the content according to your application's needs.</p>
<p><strong>Step 4: Customizing Toast Notifications</strong></p>
<p><code>react-hot-toast</code> provides various options for customizing the appearance and behavior of toast notifications. You can customize the duration, position, and styling of the toasts. Refer to the package documentation for more advanced customization options.</p>
<h3 id="heading-conclusion">Conclusion:</h3>
<p>Adding toast notifications to your React.js application is a straightforward process with the help of the <code>react-hot-toast</code> package. By following the steps outlined in this blog post, you can enhance the user experience of your application by providing timely and visually appealing feedback to users. Explore the documentation for more customization options and make your toast notifications seamlessly integrate with your application's design.</p>
]]></content:encoded></item><item><title><![CDATA[A Step-by-Step Guide to Installing Tailwind CSS with React]]></title><description><![CDATA[Are you looking to enhance your React projects with sleek and efficient styles? Tailwind CSS might be just what you need! In this guide, we'll walk you through the step-by-step installation of Tailwind CSS in your React application.
Introduction to T...]]></description><link>https://shivaydv.hashnode.dev/a-step-by-step-guide-to-installing-tailwind-css-with-react</link><guid isPermaLink="true">https://shivaydv.hashnode.dev/a-step-by-step-guide-to-installing-tailwind-css-with-react</guid><category><![CDATA[Tailwind CSS]]></category><category><![CDATA[Tailwind CSS Tutorial]]></category><category><![CDATA[Web Development]]></category><category><![CDATA[Frontend Development]]></category><category><![CDATA[getting started]]></category><dc:creator><![CDATA[Shiva Yadav]]></dc:creator><pubDate>Sun, 03 Sep 2023 14:32:48 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1693751067646/99fd6597-9e21-446d-b748-946605b2ea59.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Are you looking to enhance your React projects with sleek and efficient styles? Tailwind CSS might be just what you need! In this guide, we'll walk you through the step-by-step installation of Tailwind CSS in your React application.</p>
<h2 id="heading-introduction-to-tailwind-css"><strong>Introduction to Tailwind CSS</strong></h2>
<p>Tailwind CSS is a utility-first CSS framework that makes styling web applications a breeze. It provides a set of pre-built CSS classes that you can apply directly to your HTML elements, enabling rapid development without writing custom CSS.</p>
<h3 id="heading-why-choose-tailwind-css"><strong>Why Choose Tailwind CSS?</strong></h3>
<ul>
<li><p><strong>Speed</strong>: Quickly build stylish UI components without the need for extensive CSS files.</p>
</li>
<li><p><strong>Customization</strong>: Tailwind is highly customizable, allowing you to tailor your styles to your project's needs.</p>
</li>
<li><p><strong>Scalability</strong>: Ideal for projects of all sizes, from small websites to large applications.</p>
</li>
</ul>
<h2 id="heading-step-1-create-a-react-application"><strong>Step 1: Create a React Application</strong></h2>
<p>If you don't have a React project yet, create one using the <strong>Create React App</strong> or your preferred method.</p>
<pre><code class="lang-bash">npx create-react-app my-tailwind-app
<span class="hljs-built_in">cd</span> my-tailwind-app
</code></pre>
<h2 id="heading-step-2-install-tailwind-css"><strong>Step 2: Install Tailwind CSS</strong></h2>
<p>In your React project directory, install Tailwind CSS and its peer dependencies using npm or yarn:</p>
<pre><code class="lang-bash">npm install tailwindcss postcss-cli autoprefixer

<span class="hljs-comment"># or with yarn</span>

yarn add tailwindcss postcss-cli autoprefixer
</code></pre>
<h2 id="heading-step-3-configure-tailwind-css"><strong>Step 3: Configure Tailwind CSS</strong></h2>
<p>Generate a Tailwind CSS configuration file by running:</p>
<pre><code class="lang-bash">npx tailwindcss init
</code></pre>
<p>This will create a <code>tailwind.config.js</code> file in your project root and paste the Following Code.</p>
<pre><code class="lang-javascript"><span class="hljs-comment">/** <span class="hljs-doctag">@type <span class="hljs-type">{import('tailwindcss').Config}</span> </span>*/</span>
<span class="hljs-built_in">module</span>.exports = {
  <span class="hljs-attr">content</span>: [
    <span class="hljs-string">"./src/**/*.{js,jsx,ts,tsx}"</span>,
  ],
  <span class="hljs-attr">theme</span>: {
    <span class="hljs-attr">extend</span>: {},
  },
  <span class="hljs-attr">plugins</span>: [],
}
</code></pre>
<h2 id="heading-step-4-set-up-postcss-configuration"><strong>Step 4: Set Up PostCSS Configuration</strong></h2>
<p>Create a <code>postcss.config.js</code> file in your project's root directory with the following content:</p>
<pre><code class="lang-javascript"><span class="hljs-built_in">module</span>.exports = {
  <span class="hljs-attr">plugins</span>: [
    <span class="hljs-built_in">require</span>(<span class="hljs-string">'tailwindcss'</span>),
    <span class="hljs-built_in">require</span>(<span class="hljs-string">'autoprefixer'</span>),
  ],
}
</code></pre>
<h2 id="heading-step-5-create-your-styles"><strong>Step 5: Create Your Styles</strong></h2>
<p>Create a CSS file (e.g., <code>styles.css</code>) in your <code>src</code> folder and include the following:</p>
<pre><code class="lang-css"><span class="hljs-comment">/* src/styles.css */</span>
<span class="hljs-keyword">@import</span> <span class="hljs-string">'tailwindcss/base'</span>;
<span class="hljs-keyword">@import</span> <span class="hljs-string">'tailwindcss/components'</span>;
<span class="hljs-keyword">@import</span> <span class="hljs-string">'tailwindcss/utilities'</span>;
</code></pre>
<h2 id="heading-step-6-import-styles-in-react"><strong>Step 6: Import Styles in React</strong></h2>
<p>In your <code>src/index.js</code> file, import your <code>styles.css</code>:</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">import</span> React <span class="hljs-keyword">from</span> <span class="hljs-string">'react'</span>;
<span class="hljs-keyword">import</span> ReactDOM <span class="hljs-keyword">from</span> <span class="hljs-string">'react-dom'</span>;
<span class="hljs-keyword">import</span> <span class="hljs-string">'./styles.css'</span>; <span class="hljs-comment">// Import your styles</span>
<span class="hljs-keyword">import</span> App <span class="hljs-keyword">from</span> <span class="hljs-string">'./App'</span>;

ReactDOM.render(
  <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">React.StrictMode</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">App</span> /&gt;</span>
  <span class="hljs-tag">&lt;/<span class="hljs-name">React.StrictMode</span>&gt;</span></span>,
  <span class="hljs-built_in">document</span>.getElementById(<span class="hljs-string">'root'</span>)
);
</code></pre>
<h2 id="heading-step-7-start-your-development-server"><strong>Step 7: Start Your Development Server</strong></h2>
<p>Now, run your development server to see Tailwind CSS in action:</p>
<pre><code class="lang-bash">npm start

<span class="hljs-comment"># or with yarn</span>
yarn start
</code></pre>
<h2 id="heading-conclusion"><strong>Conclusion</strong></h2>
<p>Congratulations! You've successfully installed Tailwind CSS in your React project, enhancing your styling capabilities. Tailwind's utility-first approach will save you time and effort, allowing you to focus on building exceptional user interfaces.</p>
<p>Remember that Tailwind CSS is highly customizable, so feel free to explore the documentation and tailor it to your specific project needs.</p>
<p>Enjoy your React development journey with the power of Tailwind CSS! 🚀</p>
]]></content:encoded></item><item><title><![CDATA[Getting Started with React: Creating Your First React Project]]></title><description><![CDATA[React is a popular JavaScript library for building user interfaces. Whether you're a seasoned developer looking to dive into the world of React or a beginner just starting your journey in web development, this guide will walk you through the process ...]]></description><link>https://shivaydv.hashnode.dev/getting-started-with-react-creating-your-first-react-project</link><guid isPermaLink="true">https://shivaydv.hashnode.dev/getting-started-with-react-creating-your-first-react-project</guid><category><![CDATA[React]]></category><category><![CDATA[Web Development]]></category><category><![CDATA[Frontend Development]]></category><category><![CDATA[MERN Stack]]></category><category><![CDATA[getting started]]></category><dc:creator><![CDATA[Shiva Yadav]]></dc:creator><pubDate>Fri, 01 Sep 2023 11:36:25 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/xkBaqlcqeb4/upload/34ebb13033f6c7b99a6634e38704af15.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>React is a popular JavaScript library for building user interfaces. Whether you're a seasoned developer looking to dive into the world of React or a beginner just starting your journey in web development, this guide will walk you through the process of creating your first React project and running it. By the end of this article, you'll have a basic understanding of how React works and be well on your way to building powerful web applications.</p>
<h2 id="heading-introduction"><strong>Introduction</strong></h2>
<p>React, developed by Facebook, is a JavaScript library that simplifies the process of building interactive user interfaces. It allows you to create reusable UI components, manage the state of your application, and efficiently update the DOM, resulting in fast and responsive web applications. To get started with React, you'll need a basic understanding of HTML, CSS, and JavaScript.</p>
<h2 id="heading-requirements"><strong>Requirements</strong></h2>
<p>Before we start building our first React project, let's ensure you have the necessary tools and prerequisites in place:</p>
<ul>
<li><p><strong>Node.js and npm</strong>: React projects are typically built using Node.js and npm (Node Package Manager). You can download and install Node.js from the official website: <a target="_blank" href="https://nodejs.org/"><strong>https://nodejs.org/</strong></a></p>
</li>
<li><p><strong>Code Editor</strong>: You'll need a code editor to write and edit your React code. Popular choices include Visual Studio Code, Atom, or Sublime Text. You can download Visual Studio Code from <a target="_blank" href="https://code.visualstudio.com/download">https://code.visualstudio.com/download</a>.</p>
</li>
</ul>
<h2 id="heading-steps-to-create-your-first-react-project"><strong>Steps to Create Your First React Project</strong></h2>
<p><strong>Step 1: Create a React App</strong></p>
<p>Open your terminal or command prompt and navigate to the directory where you want to create your React project. Then, run the following command to create a new React app using the Create React App tool:</p>
<pre><code class="lang-bash">npx create-react-app my-first-react-app
</code></pre>
<p>Replace <code>my-first-react-app</code> with your desired project name.</p>
<p><strong>Step 2: Navigate to Your Project Directory</strong></p>
<p>After the creation process is complete, navigate to your project directory using the following command:</p>
<pre><code class="lang-bash"><span class="hljs-built_in">cd</span> my-first-react-app
</code></pre>
<p><strong>Step 3: Start the Development Server</strong></p>
<p>To run your React project, simply execute the following command in your project directory:</p>
<pre><code class="lang-bash">npm start
</code></pre>
<p>This command will start the development server and open your React app in your default web browser. You can access it at <a target="_blank" href="http://localhost:3000"><code>http://localhost:3000</code></a>.</p>
<p><strong>Step 4: Explore Your Project</strong></p>
<p>Open your code editor and explore the project structure. You'll find your main application code in the <code>src</code> directory, including the <code>App.js</code> file, which is the entry point for your application. You can start editing this file to build your React app.</p>
<h2 id="heading-code-snippet"><strong>Code Snippet</strong></h2>
<p>Here's a simple example of a React component in the <code>App.js</code> file to get you started:</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">import</span> React <span class="hljs-keyword">from</span> <span class="hljs-string">'react'</span>;

<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">App</span>(<span class="hljs-params"></span>) </span>{
  <span class="hljs-keyword">return</span> (
    <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">h1</span>&gt;</span>Hello, React!<span class="hljs-tag">&lt;/<span class="hljs-name">h1</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>Welcome to your first React app.<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span></span>
  );
}

<span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> App;
</code></pre>
<h2 id="heading-conclusion"><strong>Conclusion</strong></h2>
<p>Congratulations! You've successfully created your first React project and learned how to run it. React offers a powerful and efficient way to build modern web applications, and this is just the beginning of your journey. As you continue to explore and develop with React, you'll discover its vast ecosystem of libraries and tools that can help you create dynamic and responsive web applications. Keep learning, experimenting, and building to unlock the full potential of React!</p>
]]></content:encoded></item></channel></rss>