<?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: Deni Sugiarto</title>
    <description>The latest articles on DEV Community by Deni Sugiarto (@deni_sugiarto_1a01ad7c3fb).</description>
    <link>https://dev.to/deni_sugiarto_1a01ad7c3fb</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1594688%2Fc897472f-74bd-4307-8222-c6f977dd4ffa.png</url>
      <title>DEV Community: Deni Sugiarto</title>
      <link>https://dev.to/deni_sugiarto_1a01ad7c3fb</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/deni_sugiarto_1a01ad7c3fb"/>
    <language>en</language>
    <item>
      <title>Fixing “Connection Refused” Error Between pgAdmin and Postgres in Docker</title>
      <dc:creator>Deni Sugiarto</dc:creator>
      <pubDate>Thu, 10 Oct 2024 02:14:19 +0000</pubDate>
      <link>https://dev.to/deni_sugiarto_1a01ad7c3fb/fixing-connection-refused-error-between-pgadmin-and-postgres-in-docker-14ge</link>
      <guid>https://dev.to/deni_sugiarto_1a01ad7c3fb/fixing-connection-refused-error-between-pgadmin-and-postgres-in-docker-14ge</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo2yokvh4wo4lwycciwi0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo2yokvh4wo4lwycciwi0.png" alt="PostgresSQL Logo" width="300" height="168"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When setting up pgAdmin to connect with PostgreSQL in a Docker environment, a common issue developers encounter is the “Connection Refused” error. This error typically arises due to incorrect configuration of the connection parameters in pgAdmin, particularly when using service names rather than container names.&lt;/p&gt;

&lt;p&gt;In this article, we’ll walk through the steps to resolve the “Connection Refused” error by ensuring that pgAdmin connects to PostgreSQL using the container name.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Understanding the Problem&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Docker containers use an internal network for communication, and each container can be accessed using its container name as the hostname. If you’re trying to connect pgAdmin to a PostgreSQL container and using localhost or an IP address, the connection will fail because pgAdmin doesn’t know where to find the PostgreSQL instance in the Docker network.&lt;/p&gt;

&lt;p&gt;The error might look something like this in the logs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;could not connect to server: Connection refused
    Is the server running on host "localhost" and accepting
    TCP/IP connections on port 5432?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This happens because pgAdmin is not able to resolve localhost or the specified IP to the PostgreSQL container. The solution is to use the PostgreSQL container name in the connection settings.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Steps to Fix pgAdmin and PostgreSQL Connection in Docker&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Set Up docker-compose.yml&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Ensure that both pgAdmin and Postgres are part of the same Docker Compose network. Here’s a basic configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;version: '3'
services:
  postgres:
    image: postgres:14
    container_name: postgresdb
    environment:
      POSTGRES_USER: admin
      POSTGRES_PASSWORD: password
      POSTGRES_DB: mydatabase
    ports:
      - "5432:5432"
    volumes:
      - postgres_data:/var/lib/postgresql/data

  pgadmin:
    image: dpage/pgadmin4
    container_name: pgadmin
    environment:
      PGADMIN_DEFAULT_EMAIL: admin@admin.com
      PGADMIN_DEFAULT_PASSWORD: admin
    ports:
      - "8080:80"
    depends_on:
      - postgres  # Ensures pgAdmin starts after PostgreSQL
    networks:
      - pgnetwork

networks:
  pgnetwork:
    driver: bridge

volumes:
  postgres_data:
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, PostgreSQL is running inside a container named postgresdb, and pgAdmin runs in another container called pgadmin. Both containers are connected via a Docker network named pgnetwork.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Access pgAdmin and Add a New Server&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;After running docker-compose up, pgAdmin will be accessible at &lt;a href="http://localhost:8080" rel="noopener noreferrer"&gt;http://localhost:8080&lt;/a&gt;. Use the credentials you specified (&lt;a href="mailto:admin@admin.com"&gt;admin@admin.com&lt;/a&gt; and admin).&lt;/p&gt;

&lt;p&gt;To connect pgAdmin to PostgreSQL:&lt;br&gt;
a. Open pgAdmin in your browser.&lt;br&gt;
b. Click on Add New Server.&lt;br&gt;
c. In the General tab, name your server anything you like, e.g., “Postgres DB”.&lt;br&gt;
d. In the Connection tab, use the following settings:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Host name/address: postgresdb (this is the container name of your Postgres service in Docker)&lt;/li&gt;
&lt;li&gt;Port: 5432 (the default Postgres port)&lt;/li&gt;
&lt;li&gt;Username: admin (this is the POSTGRES_USER defined in the docker-compose.yml)&lt;/li&gt;
&lt;li&gt;Password: password (this is the POSTGRES_PASSWORD defined in the docker-compose.yml)&lt;/li&gt;
&lt;li&gt;Maintenance database: mydatabase (this is the POSTGRES_DB defined in the docker-compose.yml)&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;Understanding Why It Works&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;By using the container name (postgresdb) in the Host name/address field, you’re telling pgAdmin to resolve the PostgreSQL service via Docker’s internal DNS. This eliminates the need for localhost or any external IP addresses.&lt;/p&gt;

&lt;p&gt;The depends_on field in docker-compose.yml ensures that pgAdmin does not start until the Postgres container is up and running, avoiding potential timing issues that might cause connection failures.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Troubleshooting Tips&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Firewall/Port Blocking: Ensure that port 5432 (Postgres) and port 8080 (pgAdmin) are open and not blocked by any firewall or security settings on your machine.&lt;/li&gt;
&lt;li&gt;Database Logs: If you’re still experiencing issues, check the logs of both the Postgres and pgAdmin containers by running:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker-compose logs postgres
docker-compose logs pgadmin
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These logs will provide insights into any errors or warnings that can guide your debugging.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Network Inspection: You can inspect the Docker network to verify that both containers are connected and accessible by running:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker network inspect &amp;lt;network_name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In our case, it would be docker network inspect pgnetwork.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Testing the Connection&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;After completing the steps, test the connection by clicking Save in the pgAdmin interface. If everything is configured correctly, you should see your new server and be able to expand the database tree to view tables, schemas, and other details.&lt;/p&gt;

&lt;p&gt;Conclusion&lt;/p&gt;

&lt;p&gt;To resolve the “Connection Refused” error between pgAdmin and PostgreSQL when using Docker, make sure to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use the Postgres container name (not localhost or an IP) in the pgAdmin server configuration.&lt;/li&gt;
&lt;li&gt;Ensure both services are connected via the same Docker network.&lt;/li&gt;
&lt;li&gt;Verify that the docker-compose.yml file is properly configured.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By following these steps, you’ll have pgAdmin connecting to your Postgres instance smoothly within the Docker environment.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>docker</category>
      <category>pgadmin</category>
      <category>postgres</category>
    </item>
    <item>
      <title>Could not find a declaration file for module framer-motion Error in Next.js 14</title>
      <dc:creator>Deni Sugiarto</dc:creator>
      <pubDate>Sat, 27 Jul 2024 03:58:18 +0000</pubDate>
      <link>https://dev.to/deni_sugiarto_1a01ad7c3fb/could-not-find-a-declaration-file-for-module-framer-motion-error-in-nextjs-14-1gh5</link>
      <guid>https://dev.to/deni_sugiarto_1a01ad7c3fb/could-not-find-a-declaration-file-for-module-framer-motion-error-in-nextjs-14-1gh5</guid>
      <description>&lt;p&gt;When integrating Framer Motion for animations in a Next.js 14 project with TypeScript, you might encounter the following error:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Could not find a declaration file for module 'framer-motion'&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Typically, for other libraries, you might resolve this issue by installing the corresponding @types package. However, Framer Motion does not provide @types/framer-motion as it's already written in TypeScript. Instead, the issue is often related to TypeScript configuration.&lt;/p&gt;

&lt;h2&gt;
  
  
  Here's how to fix the issue:
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Update tsconfig.json
&lt;/h3&gt;

&lt;p&gt;The key to resolving the issue lies in adjusting your TypeScript configuration. Specifically, you need to change the moduleResolution option from "bundler" to "node". This ensures that TypeScript uses Node's module resolution strategy, which is more compatible with many libraries.&lt;/p&gt;

&lt;p&gt;Here's the updated tsconfig.json configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "compilerOptions": {
    "target": "ES2017",
    "lib": ["dom", "dom.iterable", "esnext"],
    "allowJs": true,
    "skipLibCheck": true,
    "strict": true,
    "forceConsistentCasingInFileNames": true,
    "noEmit": true,
    "esModuleInterop": true,
    "module": "esnext",
    "moduleResolution": "node",
    "resolveJsonModule": true,
    "isolatedModules": true,
    "jsx": "preserve",
    "incremental": true,
    "noUncheckedIndexedAccess": true,
    "plugins": [
      {
        "name": "next"
      }
    ],
    "paths": {
      "@/*": ["./*"]
    }
  },
  "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
  "exclude": ["node_modules"]
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this configuration:&lt;/p&gt;

&lt;p&gt;moduleResolution: Changed from "bundler" to "node". This setting tells TypeScript to resolve modules using Node.js conventions, which is often more reliable for third-party packages.&lt;/p&gt;

&lt;p&gt;By following these steps, you should be able to resolve the type declaration error and use Framer Motion with TypeScript in your Next.js 14 project without further issues.&lt;/p&gt;

</description>
      <category>typescript</category>
      <category>react</category>
      <category>nextjs</category>
      <category>framermotion</category>
    </item>
    <item>
      <title>How to Remove Duplicate Paths in ZSH on MacOS</title>
      <dc:creator>Deni Sugiarto</dc:creator>
      <pubDate>Sat, 13 Jul 2024 23:42:42 +0000</pubDate>
      <link>https://dev.to/deni_sugiarto_1a01ad7c3fb/how-to-remove-duplicate-paths-in-zsh-on-macos-3l68</link>
      <guid>https://dev.to/deni_sugiarto_1a01ad7c3fb/how-to-remove-duplicate-paths-in-zsh-on-macos-3l68</guid>
      <description>&lt;p&gt;Having duplicate paths in your PATH variable can clutter your environment and lead to unexpected behavior when running commands. On macOS, using the ZSH shell, you can easily remove these duplicates to ensure a clean and efficient path configuration. Here’s a quick guide on how to do it using the typeset -U PATH command.&lt;/p&gt;

&lt;h1&gt;
  
  
  What is the PATH Variable?
&lt;/h1&gt;

&lt;p&gt;The PATH variable is a crucial component of your shell environment. It defines the directories in which the shell looks for executable files in response to commands issued by the user. Over time, you might accumulate duplicate entries in your PATH, leading to inefficiencies and potential conflicts.&lt;/p&gt;

&lt;h1&gt;
  
  
  Why Remove Duplicates?
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Efficiency: A cleaner PATH means the shell can locate executables faster.&lt;/li&gt;
&lt;li&gt;Avoid Conflicts: Prevents potential issues where the shell might pick the wrong version of an executable.&lt;/li&gt;
&lt;li&gt;Maintainability: Easier to manage and understand your environment settings.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Step-by-Step Guide to Remove Duplicate Paths in
&lt;/h1&gt;

&lt;ol&gt;
&lt;li&gt;Open Your Terminal:
Start by opening your terminal application.&lt;/li&gt;
&lt;li&gt;Add the Command to Remove Duplicates:
Insert the following line into your .zshrc file. This command will ensure that your PATH variable contains unique entries.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;ZSH&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;typeset -U PATH
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Verification
&lt;/h1&gt;

&lt;p&gt;To verify that the duplicates have been removed, you can print the PATH variable and inspect it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;echo $PATH
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should see that all the paths listed are unique.&lt;/p&gt;

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

&lt;p&gt;You can keep your PATH variable clean and efficient by running the command typeset -U PATH in your terminal. This simple step ensures that your shell environment remains optimized, preventing potential conflicts and improving command lookup times. Maintaining a tidy PATH is a small but significant aspect of system administration and personal environment management.&lt;/p&gt;

</description>
      <category>terminal</category>
      <category>zsh</category>
      <category>developer</category>
    </item>
    <item>
      <title>zsh: permission denied: ./gradlew</title>
      <dc:creator>Deni Sugiarto</dc:creator>
      <pubDate>Thu, 11 Jul 2024 00:54:31 +0000</pubDate>
      <link>https://dev.to/deni_sugiarto_1a01ad7c3fb/zsh-permission-denied-gradlew-52dp</link>
      <guid>https://dev.to/deni_sugiarto_1a01ad7c3fb/zsh-permission-denied-gradlew-52dp</guid>
      <description>&lt;p&gt;Today, I ran into a problem while working on my React Native project. When I tried to execute the command ./gradlew signingReport, I received a permission denied error:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;zsh: permission denied: ./gradlew&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;To fix this issue, I changed the file permissions by running the following command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;chmod +rwx ./gradlew&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;After updating the permissions, the command executed successfully, and I was able to continue with my project.&lt;/p&gt;

&lt;p&gt;Please make sure you in android path!&lt;/p&gt;

</description>
      <category>reactnative</category>
      <category>zsh</category>
      <category>macbook</category>
    </item>
    <item>
      <title>Invalid Date in Safari</title>
      <dc:creator>Deni Sugiarto</dc:creator>
      <pubDate>Mon, 08 Jul 2024 01:43:13 +0000</pubDate>
      <link>https://dev.to/deni_sugiarto_1a01ad7c3fb/invalid-date-in-safari-4ff6</link>
      <guid>https://dev.to/deni_sugiarto_1a01ad7c3fb/invalid-date-in-safari-4ff6</guid>
      <description>&lt;p&gt;Hello everyone,&lt;/p&gt;

&lt;p&gt;Today, I encountered a weird bug that only appears in the Safari browser. It works fine in other browsers. After debugging the code in Safari, I found that filtering data by date was resulting in an empty array. I have been using dayjs as my date library for formatting and filtering.&lt;/p&gt;

&lt;p&gt;Here is the source date I use: "2024-7-1,6:0:0".&lt;/p&gt;

&lt;p&gt;After some research, I discovered that Safari requires dates to be in ISO 8601 format. To handle this, I created a function dateStringToISO that converts a date string into the ISO 8601 format. Here is the code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function dateStringToISO(dateString) {
  const date = new Date(dateString);

  // Check if the date is valid
  if (isNaN(date.getTime())) {
    throw new Error("Invalid date");
  }

  const year = date.getFullYear();
  const month = (date.getMonth() + 1).toString().padStart(2, '0');
  const day = date.getDate().toString().padStart(2, '0');

  return `${year}-${month}-${day}`;
}

// Example usage:
const date = "2024-7-1,6:0:0";
console.log(dateStringToISO(date)); // Output: 2024-07-01
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;By using this function, you can ensure that your date strings are properly formatted for Safari, avoiding issues with invalid dates.&lt;/p&gt;

&lt;p&gt;This version maintains your original points while improving readability and coherence.&lt;/p&gt;

&lt;p&gt;Update function name regarding &lt;a class="mentioned-user" href="https://dev.to/jayantbh"&gt;@jayantbh&lt;/a&gt; suggestions. Thanks for your suggestion&lt;/p&gt;

</description>
      <category>safari</category>
      <category>webdev</category>
      <category>javascript</category>
      <category>programming</category>
    </item>
    <item>
      <title>Level up your Git security: Verified commits with Kleopatra!</title>
      <dc:creator>Deni Sugiarto</dc:creator>
      <pubDate>Tue, 02 Jul 2024 23:25:59 +0000</pubDate>
      <link>https://dev.to/deni_sugiarto_1a01ad7c3fb/level-up-your-git-security-verified-commits-with-kleopatra-5147</link>
      <guid>https://dev.to/deni_sugiarto_1a01ad7c3fb/level-up-your-git-security-verified-commits-with-kleopatra-5147</guid>
      <description>&lt;p&gt;I just finished securing my GitHub workflow by setting up verified commits using Kleopatra and followed this awesome guide: &lt;a href="https://www.youtube.com/watch?v=xj9OiJL56pM"&gt;YouTube Verified Commits on GitHub from Windows PC&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why verified commits?&lt;/strong&gt;&lt;br&gt;
Having a green checkmark next to your commits on GitHub isn't just for show. It tells everyone that your changes are coming from a trusted source, adding an extra layer of security to your projects. This is especially important for open-source contributions or collaborative work.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Kleopatra to the rescue!&lt;/strong&gt;&lt;br&gt;
Kleopatra is a fantastic tool for managing GPG keys on Windows. The video walks you through the entire process, from installing GPG4Win (which includes Kleopatra) to generating your key and configuring it with GitHub.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;My experience:&lt;/strong&gt;&lt;br&gt;
Overall, the process was smooth sailing. The guide provides clear instructions, and using Kleopatra made managing the keys a breeze. Now I can push my commits with confidence, knowing they're cryptographically signed and verifiable.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Feeling secure?&lt;/strong&gt;&lt;br&gt;
If you're looking to add some extra security to your GitHub workflow, I highly recommend checking out verified commits with Kleopatra. It's a worthwhile investment for any developer!&lt;/p&gt;

&lt;p&gt;P.S.&lt;br&gt;
Have any of you tried verified commits before? Let me know your thoughts in the comments!&lt;/p&gt;

</description>
      <category>git</category>
      <category>security</category>
      <category>github</category>
      <category>programming</category>
    </item>
    <item>
      <title>Struggling with Brand Icons in Web Development? Try Simple Icons!</title>
      <dc:creator>Deni Sugiarto</dc:creator>
      <pubDate>Mon, 01 Jul 2024 02:01:49 +0000</pubDate>
      <link>https://dev.to/deni_sugiarto_1a01ad7c3fb/struggling-with-brand-icons-in-web-development-try-simple-icons-fkd</link>
      <guid>https://dev.to/deni_sugiarto_1a01ad7c3fb/struggling-with-brand-icons-in-web-development-try-simple-icons-fkd</guid>
      <description>&lt;p&gt;Choosing a useful library can be tricky during web development because each library has its pros and cons. Today, I want to share the icon libraries I frequently use. For standard icons like mail and phone, I prefer &lt;a href="https://lucide.dev/icons/" rel="noopener noreferrer"&gt;Lucide Icons&lt;/a&gt;. Lucide Icons offers a wide range of high-quality, customizable icons that are perfect for everyday use in web applications. They are lightweight and easy to implement, making them a great choice for developers who need a reliable set of standard icons.&lt;/p&gt;

&lt;p&gt;However, when it comes to brand icons, Lucide Icons doesn’t always have what I need. After some research, I discovered Simple Icons. You can check out this library at &lt;a href="https://simpleicons.org/" rel="noopener noreferrer"&gt;Simple Icons&lt;/a&gt;. Since I use React, I integrated their package library. Simple Icons offers “3150 Free SVG icons for popular brands,” which is amazing. After incorporating it into my projects, it perfectly addressed my need for standard brand icons.&lt;/p&gt;

&lt;p&gt;Here’s a quick example of how to use Simple Icons in a React project:&lt;/p&gt;

&lt;p&gt;First, install the necessary package:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// with yarn
yarn add @icons-pack/react-simple-icons

// with npm
npm add @icons-pack/react-simple-icons

// with pnpm
pnpm add @icons-pack/react-simple-icons

// with bun
bun add @icons-pack/react-simple-icons
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, you can use the icons in your React components like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { SiReact } from '@icons-pack/react-simple-icons';

function BasicExample() {
  return &amp;lt;SiReact color='#61DAFB' size={24} /&amp;gt;;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, we import icons for React, Next.js, JavaScript, and TypeScript from the react-icons package, which includes icons from Simple Icons. We then use these icons in a simple React component.&lt;/p&gt;

&lt;h1&gt;
  
  
  react #simpleicons #Nextjs #WebDevelopment #javascript #typescript
&lt;/h1&gt;

</description>
      <category>react</category>
      <category>icon</category>
      <category>library</category>
      <category>webdev</category>
    </item>
    <item>
      <title>A Comprehensive Guide to React Hook Form</title>
      <dc:creator>Deni Sugiarto</dc:creator>
      <pubDate>Fri, 28 Jun 2024 13:32:17 +0000</pubDate>
      <link>https://dev.to/deni_sugiarto_1a01ad7c3fb/a-comprehensive-guide-to-react-hook-form-2d75</link>
      <guid>https://dev.to/deni_sugiarto_1a01ad7c3fb/a-comprehensive-guide-to-react-hook-form-2d75</guid>
      <description>&lt;p&gt;&lt;em&gt;Building robust and user-friendly forms in React can be a time-consuming and error-prone process. Here's where &lt;a href="https://react-hook-form.com/" rel="noopener noreferrer"&gt;React Hook Form&lt;/a&gt; comes in, a powerful library designed to simplify and enhance form handling in your React applications.&lt;/em&gt;&lt;br&gt;
&lt;br&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  What is React Hook Form?
&lt;/h2&gt;

&lt;p&gt;React Hook Form is a lightweight library built on top of React's state management hooks (useState and useReducer) that provides a streamlined API for managing form state, validation, and submission. It leverages the power of hooks to offer a performant and composable approach to form development.&lt;br&gt;
&lt;br&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Key Features of React Hook Form:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Effortless Form State Management&lt;/strong&gt;: React Hook Form automatically manages form state using hooks, eliminating the need for manual state updates and ensuring consistency across the application.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Intuitive Validation&lt;/strong&gt;: Define validation rules for your form fields using a declarative approach, making validation logic clear and easy to understand.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Enhanced User Experience&lt;/strong&gt;: Built-in features like field resolvers, error handling, and conditional rendering contribute to a more user-friendly form experience.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Seamless Error Handling&lt;/strong&gt;: React Hook Form automatically handles errors during form submission, providing clear and actionable error messages to users.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Form Submission Handling&lt;/strong&gt;: Easily handle form submissions with a dedicated handleSubmit function that takes your form submission logic and returns the form data.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Customization and Integrations&lt;/strong&gt;: React Hook Form is flexible and integrates well with other popular libraries like Yup and Zod for advanced validation needs.
  
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Getting Started with React Hook Form:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Installation&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Bash
npm install react-hook-form
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Basic Usage&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;//JavaScript
import { useForm } from 'react-hook-form';

function MyForm() {
  const { register, handleSubmit, formState: { errors } } = useForm();

  const onSubmit = (data) =&amp;gt; {
    console.log(data); // Log form data on submission
  };

  return (
    &amp;lt;form onSubmit={handleSubmit(onSubmit)}&amp;gt;
      &amp;lt;input {...register('name', { required: true })} placeholder="Name" /&amp;gt;
      {errors.name &amp;amp;&amp;amp; &amp;lt;span&amp;gt;Name is required&amp;lt;/span&amp;gt;}
      &amp;lt;input {...register('email', { required: true, pattern: /^\S+@\S+\.\S+$/ })} placeholder="Email" /&amp;gt;
      {errors.email &amp;amp;&amp;amp; &amp;lt;span&amp;gt;Please enter a valid email address&amp;lt;/span&amp;gt;}
      &amp;lt;button type="submit"&amp;gt;Submit&amp;lt;/button&amp;gt;
    &amp;lt;/form&amp;gt;
  );
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;h2&gt;
  
  
  Advanced Usage:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Customization&lt;/strong&gt;: React Hook Form allows customizing form state, validation messages, and field rendering behaviors.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Built-in Field Resolvers&lt;/strong&gt;: Utilize built-in resolvers for common field types like checkboxes, radio buttons, and select elements.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Custom Validation Logic&lt;/strong&gt;: You can integrate third-party validation libraries like Yup or Zod for more complex validation scenarios.


&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Benefits of Using React Hook Form:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Reduced Boilerplate Code&lt;/strong&gt;: React Hook Form eliminates the need for manual state management and custom validation logic, streamlining your form development process.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Improved Code Readability&lt;/strong&gt;: The declarative approach for validation and form state management contributes to more readable and maintainable code.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Enhanced Developer Experience&lt;/strong&gt;: React Hook Form provides a developer-friendly API that simplifies form handling and debugging.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reduced Errors&lt;/strong&gt;: Automatic form state management and validation help minimize errors during form development.

&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  When to Use React Hook Form:
&lt;/h2&gt;

&lt;p&gt;React Hook Form is an excellent choice for a wide range of form-driven applications, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Simple Contact Forms&lt;/strong&gt;: Easily build basic contact forms with validation for name, email, and messages.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Complex Registration Forms&lt;/strong&gt;: Manage multi-step registration forms with validation for various user inputs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Login and Signup Forms&lt;/strong&gt;: Implement secure login and signup forms with validation for usernames, passwords, and email addresses.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Data Collection Forms&lt;/strong&gt;: Create forms for collecting user data, ensuring data integrity through validation.

&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;React Hook Form is a valuable tool for React developers seeking a more efficient and enjoyable approach to form management. By embracing hooks, intuitive validation, and streamlined state management, React Hook Form empowers you to build user-friendly and robust forms that enhance the user experience of your React applications.&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Additional Considerations:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Error Handling Customization&lt;/strong&gt;: Explore customizing error messages and rendering to match your application's design and user experience needs.&lt;br&gt;
&lt;strong&gt;Advanced Validation Scenarios&lt;/strong&gt;: Consider using Yup or Zod for complex validation needs that require intricate rules and error messages.&lt;br&gt;
&lt;strong&gt;Accessibility&lt;/strong&gt;: Ensure that your forms are accessible by following&lt;/p&gt;

</description>
      <category>react</category>
      <category>webdev</category>
      <category>form</category>
      <category>reactjsdevelopment</category>
    </item>
    <item>
      <title>Top 5 reasons why choose React.js for your web projects:</title>
      <dc:creator>Deni Sugiarto</dc:creator>
      <pubDate>Thu, 27 Jun 2024 23:54:26 +0000</pubDate>
      <link>https://dev.to/deni_sugiarto_1a01ad7c3fb/here-are-the-top-5-reasons-why-you-should-choose-reactjs-for-your-web-development-projects-1lf2</link>
      <guid>https://dev.to/deni_sugiarto_1a01ad7c3fb/here-are-the-top-5-reasons-why-you-should-choose-reactjs-for-your-web-development-projects-1lf2</guid>
      <description>&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh8h8chsav8vafwrd4tkl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh8h8chsav8vafwrd4tkl.png" alt="Image description" width="300" height="168"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Component-Based Architecture: React.js uses a component-based architecture, allowing you to break down your UI into small, reusable pieces. Each component manages its own state, making it easier to build and maintain complex user interfaces. This modularity enhances code reusability and scalability, saving time and effort in development.&lt;/p&gt;

&lt;p&gt;Declarative Syntax with JSX: React's use of JSX (JavaScript XML) allows you to write components using a syntax that closely resembles HTML. This declarative approach makes your code more readable and easier to understand, as it clearly defines how your UI should look based on the current application state.&lt;/p&gt;

&lt;p&gt;Virtual DOM for Efficient Updates: React introduces a virtual DOM, a lightweight representation of the actual DOM. React's reconciliation algorithm efficiently updates the virtual DOM and applies only the necessary changes to the real DOM, minimizing browser reflows and enhancing application performance. This approach results in faster rendering and smoother user experiences.&lt;/p&gt;

&lt;p&gt;Strong Ecosystem and Community Support: React.js benefits from a vast ecosystem of tools, libraries, and resources supported by a large and active community. Whether you need routing (React Router), state management (Redux, MobX), or UI components (Material-UI, Ant Design), you can find robust solutions and community-driven support to accelerate your development process.&lt;/p&gt;

&lt;p&gt;Backed by Facebook and Community: React.js is developed and maintained by Facebook, ensuring robustness, reliability, and continuous improvement. Additionally, its popularity has fostered a strong community of developers who contribute to its growth and share best practices, making React.js a solid choice for building modern web applications.&lt;/p&gt;

&lt;p&gt;These reasons collectively make React.js a preferred framework for front-end development, offering developers powerful tools and techniques to create dynamic, interactive, and scalable user interfaces efficiently.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>programming</category>
      <category>react</category>
    </item>
  </channel>
</rss>
