<?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: Abdullah Munshi</title>
    <description>The latest articles on DEV Community by Abdullah Munshi (@abdullahmunshi).</description>
    <link>https://dev.to/abdullahmunshi</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1185547%2F00e230ea-19aa-4150-bac5-eaafd374cc97.jpeg</url>
      <title>DEV Community: Abdullah Munshi</title>
      <link>https://dev.to/abdullahmunshi</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/abdullahmunshi"/>
    <language>en</language>
    <item>
      <title>Confusion about loading state variable</title>
      <dc:creator>Abdullah Munshi</dc:creator>
      <pubDate>Sun, 21 Sep 2025 16:06:22 +0000</pubDate>
      <link>https://dev.to/abdullahmunshi/confusion-about-loading-state-variable-58i6</link>
      <guid>https://dev.to/abdullahmunshi/confusion-about-loading-state-variable-58i6</guid>
      <description>&lt;p&gt;I am a growing full-stack developer. on a project I am a bit confuse of using loading state variable. should I use separate loading state variable for each type of crud action? for example in redux cart slice we should add separate loading variable for addtocart, deletefromcart, updatingcart methods? what's professionals do?&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Type issu in Nextjs app.</title>
      <dc:creator>Abdullah Munshi</dc:creator>
      <pubDate>Wed, 26 Jun 2024 14:12:05 +0000</pubDate>
      <link>https://dev.to/abdullahmunshi/type-issu-in-nextjs-app-40dn</link>
      <guid>https://dev.to/abdullahmunshi/type-issu-in-nextjs-app-40dn</guid>
      <description>&lt;p&gt;[Help please] how can i solve the issue? there is an object called diary comming from an database and passed to  component where a useState hook expecting that object. at build time it gives the following error. &lt;br&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%2Fvkckwr3kd9oka6a7b1um.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%2Fvkckwr3kd9oka6a7b1um.png" alt="Image description" width="800" height="109"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;import { db } from "@/db";&lt;br&gt;
import DiaryEditForm from "@/components/diary-edit-form";&lt;br&gt;
interface DiaryEditPageProps {&lt;br&gt;
  params: {&lt;br&gt;
    id: string;&lt;br&gt;
  };&lt;br&gt;
}&lt;br&gt;
export default async function DiaryEditPage(props: DiaryEditPageProps) {&lt;br&gt;
  const id = parseInt(props.params.id);&lt;br&gt;
  const diary = await db.diary.findFirst({&lt;br&gt;
    where: { id },&lt;br&gt;
  });&lt;br&gt;
  return (&lt;br&gt;
    &amp;lt;div&amp;gt;&lt;br&gt;
      &amp;lt;DiaryEditForm diary={diary} /&amp;gt;&lt;br&gt;
    &amp;lt;/div&amp;gt;&lt;br&gt;
  );&lt;br&gt;
}&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;`"use client";&lt;/p&gt;

&lt;p&gt;import { Diary } from "@prisma/client";&lt;br&gt;
import { useState } from "react";&lt;br&gt;
import * as actions from "@/actions";&lt;/p&gt;

&lt;p&gt;interface DiaryEditFormProps {&lt;br&gt;
  diary: Diary;&lt;br&gt;
}&lt;br&gt;
export default function DiaryEditForm({ diary }: DiaryEditFormProps) {&lt;br&gt;
  const [content, setContent] = useState(diary);&lt;br&gt;
  const handleEditorChange = (event: {&lt;br&gt;
    target: { name: string; value: string };&lt;br&gt;
  }) =&amp;gt; {&lt;br&gt;
    const { name, value } = event.target;&lt;br&gt;
    setContent((prevContent) =&amp;gt; ({&lt;br&gt;
      ...prevContent,&lt;br&gt;
      [name]: value,&lt;br&gt;
    }));&lt;br&gt;
  };&lt;br&gt;
  const editDiaryAction = actions.editDiary.bind(&lt;br&gt;
    null,&lt;br&gt;
    diary.id,&lt;br&gt;
    content.title,&lt;br&gt;
    content.description&lt;br&gt;
  );&lt;br&gt;
  return (&lt;br&gt;
    &lt;/p&gt;
&lt;br&gt;
      &lt;h1&gt;Edit your Diary&lt;/h1&gt;
&lt;br&gt;
      &lt;br&gt;
        
          htmlFor="title"&lt;br&gt;
          className="block text-gray-700 font-medium mb-2 leading-tight"&lt;br&gt;
        &amp;gt;&lt;br&gt;
          Title&lt;br&gt;
        &lt;br&gt;
        
          type="text"&lt;br&gt;
          name="title"&lt;br&gt;
          id="title"&lt;br&gt;
          value={content.title}&lt;br&gt;
          onChange={handleEditorChange}&lt;br&gt;
          className="w-full px-3 py-2 border border-gray-300 rounded focus:outline-none focus:border-gray-500"&lt;br&gt;
        /&amp;gt;&lt;br&gt;
      &lt;br&gt;
      &lt;br&gt;
        
          htmlFor="description"&lt;br&gt;
          className="block text-gray-700 font-medium mb-2 leading-tight"&lt;br&gt;
        &amp;gt;&lt;br&gt;
          Description&lt;br&gt;
        &lt;br&gt;
        
          name="description"&lt;br&gt;
          id="description"&lt;br&gt;
          value={content.description}&lt;br&gt;
          onChange={handleEditorChange}&lt;br&gt;
          className="min-h-32 w-full px-3 py-2 border border-gray-300 rounded focus:outline-none focus:border-gray-500"&lt;br&gt;
        &amp;gt;&lt;br&gt;
      
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  &amp;lt;button
    type="submit"
    className="bg-gray-600 text-white px-4 py-2 rounded"
  &amp;gt;
    Save
  &amp;lt;/button&amp;gt;
&amp;lt;/form&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;);&lt;br&gt;
}&lt;br&gt;
`&lt;/p&gt;

</description>
      <category>nextjs</category>
      <category>typescript</category>
      <category>reactjsdevelopment</category>
      <category>nextjsdevelopment</category>
    </item>
  </channel>
</rss>
