<?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: Dhokai Raj </title>
    <description>The latest articles on DEV Community by Dhokai Raj  (@rajdhokai).</description>
    <link>https://dev.to/rajdhokai</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%2F1450945%2F04193af7-8f82-45a7-86c7-060745231713.jpeg</url>
      <title>DEV Community: Dhokai Raj </title>
      <link>https://dev.to/rajdhokai</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rajdhokai"/>
    <language>en</language>
    <item>
      <title>Why is Google's best image model called "Nano Banana"? And why are you using the wrong one?</title>
      <dc:creator>Dhokai Raj </dc:creator>
      <pubDate>Sat, 23 May 2026 16:06:30 +0000</pubDate>
      <link>https://dev.to/rajdhokai/why-is-googles-best-image-model-called-nano-banana-and-why-are-you-using-the-wrong-one-h08</link>
      <guid>https://dev.to/rajdhokai/why-is-googles-best-image-model-called-nano-banana-and-why-are-you-using-the-wrong-one-h08</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/google-io-writing-2026-05-19"&gt;Google I/O 2026 Writing Challenge&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Google now has six image models (one is called "Nano Banana"). Here's which to actually use.
&lt;/h1&gt;

&lt;p&gt;Everyone covering Google I/O 2026 is writing about agents, Antigravity, and whether AI is coming for our jobs. Meanwhile, I opened &lt;a href="https://aistudio.google.com/" rel="noopener noreferrer"&gt;AI Studio&lt;/a&gt;, clicked into image generation, and found a quietly hilarious situation: &lt;strong&gt;six different image models&lt;/strong&gt;, two completely different &lt;em&gt;families&lt;/em&gt;, prices ranging nearly &lt;strong&gt;7×&lt;/strong&gt;, and one of them is officially named &lt;strong&gt;"Nano Banana."&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Nobody's written the guide for this. So here it is — the two families, what each is for, and the price-vs-quality call, in plain terms.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;💡 &lt;em&gt;[Screenshot spot: the AI Studio model picker filtered to image models, showing Nano Banana / Nano Banana Pro / Imagen 4 stacked. Or even better — a single image you generated, with the prompt shown.]&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Two families, two totally different jobs
&lt;/h2&gt;

&lt;p&gt;This is the part the model names actively hide. Google has &lt;strong&gt;two separate lines of image models&lt;/strong&gt;, and they're built for different things:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Family 1 — Imagen 4 (the dedicated text-to-image line).&lt;/strong&gt; You give it a prompt, it gives you a picture. Pure generation, no conversation. It's the cheapest and fastest path to "make me an image."&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Model&lt;/th&gt;
&lt;th&gt;Price per image&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Imagen 4 Fast&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;$0.02&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Imagen 4&lt;/td&gt;
&lt;td&gt;$0.04&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Imagen 4 Ultra&lt;/td&gt;
&lt;td&gt;$0.06&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Family 2 — "Nano Banana" / Gemini Image (the conversational line).&lt;/strong&gt; These are Gemini models with image generation built in. You don't just prompt them — you &lt;em&gt;talk&lt;/em&gt; to them. "Make the sky orange." "Now remove the car." "Keep everything but change the text on the sign." They reason about the image and edit it in context, because they're full multimodal models under the hood.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Model (a.k.a.)&lt;/th&gt;
&lt;th&gt;Real ID&lt;/th&gt;
&lt;th&gt;Price per image&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Nano Banana (Gemini 2.5 Flash Image)&lt;/td&gt;
&lt;td&gt;&lt;code&gt;gemini-2.5-flash-image&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;$0.039&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;Nano Banana 2&lt;/strong&gt; (Gemini 3.1 Flash Image)&lt;/td&gt;
&lt;td&gt;&lt;code&gt;gemini-3.1-flash-image-preview&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;$0.0672&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;Nano Banana Pro&lt;/strong&gt; (Gemini 3 Pro Image)&lt;/td&gt;
&lt;td&gt;&lt;code&gt;gemini-3-pro-image-preview&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;$0.134&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;(Yes, "Nano Banana" is the real product nickname. Yes, "Nano Banana Pro" uses a &lt;em&gt;Gemini 3 Pro&lt;/em&gt; backbone while "Nano Banana 2" uses &lt;em&gt;Gemini 3.1 Flash&lt;/em&gt; — so the "2" is newer than the "Pro." The naming is a maze. The capabilities are what matter.)&lt;/p&gt;

&lt;h2&gt;
  
  
  The 7× spread, and why it exists
&lt;/h2&gt;

&lt;p&gt;Imagen 4 Fast is &lt;strong&gt;$0.02&lt;/strong&gt; an image. Nano Banana Pro is &lt;strong&gt;$0.134&lt;/strong&gt; — about &lt;strong&gt;6.7× more.&lt;/strong&gt; That's not a rip-off; you're paying for two different things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The cheap Imagen models are &lt;strong&gt;generators&lt;/strong&gt;. One prompt, one image, done. Brilliant for volume — product mockups, thumbnails, social assets, anything where you'll generate hundreds and pick the best.&lt;/li&gt;
&lt;li&gt;The pricier Nano Banana models are &lt;strong&gt;editors and reasoners&lt;/strong&gt;. They hold the image in context and let you iterate conversationally, preserve details across edits, and ground the result in reality (text that's actually spelled right, hands with five fingers). You pay more because you're getting an image &lt;em&gt;collaborator&lt;/em&gt;, not a vending machine.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Which one should you use?
&lt;/h2&gt;

&lt;p&gt;The decision guide AI Studio doesn't give you:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Reach for Imagen 4 (Fast / standard / Ultra) when:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You need lots of images cheaply, from a prompt, with no editing loop.&lt;/li&gt;
&lt;li&gt;Use &lt;strong&gt;Fast ($0.02)&lt;/strong&gt; for drafts and high volume, &lt;strong&gt;standard ($0.04)&lt;/strong&gt; for most production, &lt;strong&gt;Ultra ($0.06)&lt;/strong&gt; when you need the best single-shot quality.&lt;/li&gt;
&lt;li&gt;Think: marketing assets, blog headers, product variations, anything batch.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Reach for Nano Banana / Gemini Image when:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You need to &lt;em&gt;edit&lt;/em&gt; iteratively — "change this, keep that" — or have a conversation about the image.&lt;/li&gt;
&lt;li&gt;You need reliable text-in-image, precise edits, or reality-grounded detail.&lt;/li&gt;
&lt;li&gt;Use &lt;strong&gt;Nano Banana 2 ($0.067)&lt;/strong&gt; as the balanced default; step up to &lt;strong&gt;Nano Banana Pro ($0.134)&lt;/strong&gt; only when you need top-tier editing fidelity and it's worth ~2×.&lt;/li&gt;
&lt;li&gt;Think: design iteration, image editing tools, anything where the first output is the &lt;em&gt;start&lt;/em&gt; of a conversation.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;The rule of thumb:&lt;/strong&gt; &lt;em&gt;generating&lt;/em&gt; → Imagen. &lt;em&gt;Editing or iterating&lt;/em&gt; → Nano Banana. Most people will default to whatever's at the top of the dropdown and overpay (or underpower) without realizing there were two different tools.&lt;/p&gt;

&lt;h2&gt;
  
  
  A couple of gotchas worth knowing
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Per-image pricing is separate from text pricing.&lt;/strong&gt; The Nano Banana models also charge for the text tokens in your prompt/conversation (e.g., Nano Banana 2 is $0.50 in / $3.00 out per million text tokens, &lt;em&gt;plus&lt;/em&gt; $0.0672 per image). Imagen is effectively just the per-image cost. For chatty editing sessions, those text tokens add up.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;"Preview" means impermanent.&lt;/strong&gt; Nano Banana 2 and Pro are both &lt;em&gt;preview&lt;/em&gt; models. Great for building now, but don't hard-code a preview model ID into something you can't easily change later.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Newer ≠ higher number.&lt;/strong&gt; Nano Banana 2 (Flash, Feb 2026) is newer than Nano Banana Pro (Pro backbone, Nov 2025). Pick by the &lt;em&gt;backbone and job&lt;/em&gt;, not the suffix.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The takeaway
&lt;/h2&gt;

&lt;p&gt;While the rest of the internet argues about whether agents will replace developers, Google quietly shipped a six-model image stack split across two philosophies — &lt;em&gt;generate fast and cheap&lt;/em&gt; (Imagen) versus &lt;em&gt;edit and reason&lt;/em&gt; (Nano Banana) — with a 7× price spread and names that tell you almost nothing.&lt;/p&gt;

&lt;p&gt;The five-second version: &lt;strong&gt;if you're producing images, start with Imagen 4. If you're editing them, reach for Nano Banana. Match the tool to the verb, and you'll get better images for less money than whoever just clicked the first option.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Open AI Studio, generate the same prompt on Imagen 4 Fast and on Nano Banana 2, and look at the difference for yourself. Five minutes, and the dropdown stops being a mystery.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Model names, IDs, and per-image prices are from Google AI Studio's model picker during the I/O 2026 window; verify current pricing on the &lt;a href="https://ai.google.dev/gemini-api/docs/pricing" rel="noopener noreferrer"&gt;official Gemini API pricing page&lt;/a&gt; before relying on it, as preview models and prices change. I drafted this post with AI assistance and verified the details against AI Studio myself — the analysis and any generated images are mine.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>googleiochallenge</category>
      <category>ai</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Most AIs forget... Gemma 4 can hold 300 pages.</title>
      <dc:creator>Dhokai Raj </dc:creator>
      <pubDate>Sat, 23 May 2026 07:27:59 +0000</pubDate>
      <link>https://dev.to/rajdhokai/most-ais-forget-gemma-4-can-hold-300-pages-406m</link>
      <guid>https://dev.to/rajdhokai/most-ais-forget-gemma-4-can-hold-300-pages-406m</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/google-gemma-2026-05-06"&gt;Gemma 4 Challenge: Write About Gemma 4&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Most AIs forget what you said five messages ago. Gemma 4 can hold 300 pages. Here's why that changes everything.
&lt;/h1&gt;

&lt;p&gt;You have probably felt this without naming it. You are deep in a chat with an AI, you have explained your project across a dozen messages, and then it asks you something you &lt;em&gt;already answered&lt;/em&gt; twenty minutes ago. It forgot. Not because it is dumb — because it ran out of room.&lt;/p&gt;

&lt;p&gt;Every AI model has a limit on how much it can "see" at once. Gemma 4's limit is &lt;strong&gt;128K tokens&lt;/strong&gt; — roughly 300 pages of text in a single go. That number gets thrown around a lot without anyone explaining what it actually buys you. So let me explain it from scratch, show you what I did with it, and then — for the readers who want depth — the catch that the headlines leave out.&lt;/p&gt;

&lt;h2&gt;
  
  
  What a "context window" actually is
&lt;/h2&gt;

&lt;p&gt;Forget the jargon for a second.&lt;/p&gt;

&lt;p&gt;A context window is the AI's &lt;strong&gt;working desk&lt;/strong&gt;. Everything it can look at &lt;em&gt;right now&lt;/em&gt; — your question, the conversation so far, any document you pasted in — has to fit on that desk. Anything that doesn't fit falls off the edge and is gone. The model doesn't "remember" it, because it never sees it.&lt;/p&gt;

&lt;p&gt;A &lt;strong&gt;token&lt;/strong&gt; is just a chunk of text — roughly ¾ of a word. "128K tokens" means about 96,000 words can sit on the desk at once.&lt;/p&gt;

&lt;p&gt;For years, that desk was tiny. Early models had room for a few pages. So if you wanted help with a long document, you had to chop it into pieces, feed them one at a time, and stitch the answers together yourself. Clumsy, and the model never saw the whole picture.&lt;/p&gt;

&lt;p&gt;Gemma 4's desk fits a small book.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I actually did with it
&lt;/h2&gt;

&lt;p&gt;I wanted to feel the difference, not just read the spec. So I tried three things you can try too.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. A whole book.&lt;/strong&gt; I pasted the full text of a public-domain novel (about 250 pages) and asked, &lt;em&gt;"What does the main character want, and where does that change?"&lt;/em&gt; It answered with references from chapter 2 &lt;em&gt;and&lt;/em&gt; chapter 19 — connecting the beginning to the end. A small-context model literally cannot do this; it would never have both chapters on the desk at the same time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. A long, boring contract.&lt;/strong&gt; I dropped in a 40-page rental agreement and asked, &lt;em&gt;"List anything that costs me money beyond the rent."&lt;/em&gt; It pulled out the cleaning fee on page 11, the late penalty on page 28, and the carpet clause on page 36 — scattered across the document. No chopping, no stitching. One question, one answer.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. An entire small codebase.&lt;/strong&gt; I pasted ~20 source files and asked, &lt;em&gt;"Where does this app decide if a user is logged in?"&lt;/em&gt; It traced the logic across three files. For anyone who has joined a new project and felt lost, that is a genuinely useful trick.&lt;/p&gt;

&lt;p&gt;The common thread: I stopped pre-digesting things for the AI. I handed it the whole thing and asked one honest question.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why this is a turning point (the beginner version)
&lt;/h2&gt;

&lt;p&gt;Big context removes a whole category of busywork:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;No more chopping documents into pieces.&lt;/strong&gt; If it fits in 300 pages, just paste it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The AI sees connections across the whole thing&lt;/strong&gt; — the clue in chapter 2 and the payoff in chapter 19, at the same time.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;You ask once instead of ten times.&lt;/strong&gt; Less back-and-forth, fewer "as I mentioned earlier" moments.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And because Gemma 4 also comes in sizes small enough to run on your own laptop, you can do all of this &lt;em&gt;locally&lt;/em&gt; — your 40-page contract or private codebase never has to leave your machine. For sensitive documents, that is the whole ballgame.&lt;/p&gt;

&lt;h2&gt;
  
  
  The catch (the advanced version)
&lt;/h2&gt;

&lt;p&gt;Here is what the headline number won't tell you. If you only want the beginner takeaway, you can stop above — but if you build with this, read on.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. "Lost in the middle" is real.&lt;/strong&gt; Models pay the most attention to the &lt;em&gt;start&lt;/em&gt; and &lt;em&gt;end&lt;/em&gt; of a long context, and can gloss over things buried in the middle. If a critical clause is on page 150 of 300, it is more likely to be missed than the same clause on page 1 or page 300. Practical fix: put the most important material near the top or bottom of what you paste, and ask pointed questions rather than "summarize everything."&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Long context is slower and heavier.&lt;/strong&gt; Filling the whole window takes more memory and more time per answer. On a laptop, a near-full 128K prompt can go from "instant" to "go make coffee." Use the space when you need it; don't pad prompts for the sake of it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. 128K is large, not infinite.&lt;/strong&gt; A whole code repository, a year of chat logs, or a shelf of PDFs will still blow past 300 pages. For those, you still want &lt;strong&gt;RAG&lt;/strong&gt; (retrieval-augmented generation) — a fancy term for "search the giant pile first, then hand the AI only the relevant few pages." Big context doesn't kill RAG; it just raises the threshold where you need it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. More context is not always better answers.&lt;/strong&gt; A focused 5-page prompt often beats a bloated 250-page one, because the signal isn't drowned in noise. Big context is a tool for when you genuinely need breadth — not a default setting.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it yourself
&lt;/h2&gt;

&lt;p&gt;Easiest path, no install: open &lt;strong&gt;Google AI Studio&lt;/strong&gt; (&lt;a href="https://aistudio.google.com" rel="noopener noreferrer"&gt;aistudio.google.com&lt;/a&gt;), pick a Gemma 4 model, paste a long document (a public-domain book from &lt;a href="https://www.gutenberg.org" rel="noopener noreferrer"&gt;Project Gutenberg&lt;/a&gt; works great), and ask a question that requires connecting two distant parts. Watch it reach across the whole thing.&lt;/p&gt;

&lt;p&gt;Want it private and local? Install &lt;strong&gt;Ollama&lt;/strong&gt; (&lt;a href="https://ollama.com" rel="noopener noreferrer"&gt;ollama.com&lt;/a&gt;), pull a Gemma 4 model, and feed it a long file from your own machine — nothing uploaded.&lt;/p&gt;

&lt;h2&gt;
  
  
  The takeaway
&lt;/h2&gt;

&lt;p&gt;A bigger context window sounds like a boring spec bump. It isn't. It quietly removes the most annoying part of working with AI: being the model's memory for it. You hand over the whole book, the whole contract, the whole codebase — and ask your question like you would to a colleague who actually read it.&lt;/p&gt;

&lt;p&gt;Just remember the catch: keep the important stuff near the edges, expect it to be slower when full, and reach for search when 300 pages isn't enough. Used well, it is the difference between an AI that forgets and one that &lt;em&gt;follows along&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;If you try the book trick, ask it something that needs chapter 1 &lt;em&gt;and&lt;/em&gt; the final chapter — that's where you feel the 300 pages click into place.&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>gemmachallenge</category>
      <category>gemma</category>
      <category>ai</category>
    </item>
    <item>
      <title>Monday Morning Meeting – CSS Office Culture Scene ☕💼</title>
      <dc:creator>Dhokai Raj </dc:creator>
      <pubDate>Mon, 28 Jul 2025 06:52:30 +0000</pubDate>
      <link>https://dev.to/rajdhokai/digital-office-css-art-office-culture-j0m</link>
      <guid>https://dev.to/rajdhokai/digital-office-css-art-office-culture-j0m</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for &lt;a href="https://dev.to/challenges/frontend/axero"&gt;Frontend Challenge: Office Edition sponsored by Axero, CSS Art: Office Culture&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  🧠 Inspiration
&lt;/h2&gt;

&lt;p&gt;This piece captures a familiar scene in many workplaces: the &lt;strong&gt;Monday morning meeting&lt;/strong&gt;. From laptops to coffee cups, from speech bubbles echoing corporate buzzwords to stressed expressions and floating motivation—it’s a lighthearted satire on modern office life. The idea was to create something fun, relatable, and full of small storytelling details using only HTML and CSS.&lt;/p&gt;

&lt;h2&gt;
  
  
  🚀 Demo
&lt;/h2&gt;

&lt;p&gt;🔗 &lt;strong&gt;Live Demo:&lt;/strong&gt; &lt;br&gt;
&lt;iframe height="600" src="https://codepen.io/rajdhokai/embed/MYajdwM?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;br&gt;
📁 &lt;strong&gt;GitHub Code:&lt;/strong&gt; &lt;a href="https://github.com/rajdhokai/monday-meeting-css-art" rel="noopener noreferrer"&gt;github.com/office-culture&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🖼️ &lt;strong&gt;Preview:&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  ✨ Journey
&lt;/h2&gt;

&lt;p&gt;I wanted to bring a full-blown office scene to life using only HTML and CSS. Here are some highlights:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🎨 &lt;strong&gt;Pure CSS Art&lt;/strong&gt;: No images or SVGs—everything is crafted using &lt;code&gt;div&lt;/code&gt;s and CSS gradients.&lt;/li&gt;
&lt;li&gt;🧍‍♂️ Boss and 4 Employees with individual styles.&lt;/li&gt;
&lt;li&gt;💻 3D-style laptops on the meeting table using &lt;code&gt;transform&lt;/code&gt; and &lt;code&gt;perspective&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;☕ Coffee cups with handles and tops.&lt;/li&gt;
&lt;li&gt;🗨️ Speech bubbles with actual workplace jargon (we’ve all heard “circle back”, right? 😅).&lt;/li&gt;
&lt;li&gt;🕒 A clock on the wall and a floating &lt;strong&gt;"TEAMWORK!"&lt;/strong&gt; banner for some extra motivation.&lt;/li&gt;
&lt;li&gt;📊 A whiteboard with a faux bar chart and the word &lt;strong&gt;"SYNERGY"&lt;/strong&gt; to complete the buzz.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  What I Learned
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;How to layer and position elements precisely in a confined layout.&lt;/li&gt;
&lt;li&gt;Crafting 3D illusions using &lt;code&gt;transform&lt;/code&gt;, shadows, and gradients.&lt;/li&gt;
&lt;li&gt;Balancing humor and art with minimal HTML.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  What’s Next?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Make the scene responsive for mobile.&lt;/li&gt;
&lt;li&gt;Animate the characters or add interactivity via JavaScript in a future version.&lt;/li&gt;
&lt;li&gt;Explore more workplace moments—maybe a lunchroom or coffee break next!&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;Thanks for checking out my submission!&lt;br&gt;
Happy coding and good luck to everyone participating in the challenge! 🚀&lt;/p&gt;




</description>
      <category>frontendchallenge</category>
      <category>devchallenge</category>
      <category>css</category>
    </item>
    <item>
      <title>Think, Move, Win: The Maze Robot Escape Alibaba Cloud Web Game</title>
      <dc:creator>Dhokai Raj </dc:creator>
      <pubDate>Sun, 20 Apr 2025 19:16:33 +0000</pubDate>
      <link>https://dev.to/rajdhokai/think-move-win-the-maze-robot-escape-alibaba-cloud-web-game-4i0p</link>
      <guid>https://dev.to/rajdhokai/think-move-win-the-maze-robot-escape-alibaba-cloud-web-game-4i0p</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://int.alibabacloud.com/m/1000402443/" rel="noopener noreferrer"&gt;Alibaba Cloud&lt;/a&gt; Challenge: &lt;a href="https://dev.to/challenges/alibaba"&gt;Build a Web Game&lt;/a&gt;.&lt;/em&gt;*&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;I built &lt;strong&gt;Maze Robot Game&lt;/strong&gt;, a fun and interactive browser-based puzzle game where players guide a robot through a maze to reach its goal. The game is built using &lt;strong&gt;React&lt;/strong&gt;, &lt;strong&gt;TypeScript&lt;/strong&gt;, and &lt;strong&gt;Vite&lt;/strong&gt;, and styled with &lt;strong&gt;Tailwind CSS&lt;/strong&gt; for a clean and responsive design. The goal is to combine logic and pathfinding with a simple, engaging UI that anyone can play in the browser.&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;👉 Live Demo: &lt;a href="https://maze-robot-game.vercel.app/" rel="noopener noreferrer"&gt;https://maze-robot-game.vercel.app/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;👉 OSS deployed url: &lt;a href="http://maze-robot-game.store" rel="noopener noreferrer"&gt;http://maze-robot-game.store&lt;/a&gt;&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/rajdhokai" rel="noopener noreferrer"&gt;
        rajdhokai
      &lt;/a&gt; / &lt;a href="https://github.com/rajdhokai/maze-robot-game" rel="noopener noreferrer"&gt;
        maze-robot-game
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
       A React-based interactive game where a robot navigates through a dynamically rendered maze. Built with Vite, Tailwind CSS, and TypeScript for lightning-fast performance and modern styling.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;🧠 rajdhokai / Maze Robot Game&lt;/h3&gt;
&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;🤖 Maze Robot Game&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;Maze Robot Game is an interactive browser-based puzzle game where you help a robot navigate through a maze to its goal!&lt;br&gt;
Built using &lt;strong&gt;React&lt;/strong&gt;, &lt;strong&gt;Vite&lt;/strong&gt;, &lt;strong&gt;TypeScript&lt;/strong&gt;, and styled with &lt;strong&gt;Tailwind CSS&lt;/strong&gt;, it's designed for smooth gameplay and modern UI.&lt;/p&gt;

&lt;p&gt;🎮 &lt;strong&gt;Game Features&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;🧠 &lt;strong&gt;Maze Logic &amp;amp; Movement&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The robot moves through a grid-based maze.&lt;/li&gt;
&lt;li&gt;Players control movement with arrow keys.&lt;/li&gt;
&lt;li&gt;Logic prevents wall collisions and ensures valid paths.&lt;/li&gt;
&lt;li&gt;The structure allows for dynamic mazes in the future.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;🎨 &lt;strong&gt;UI &amp;amp; UX&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Responsive and clean layout using Tailwind CSS.&lt;/li&gt;
&lt;li&gt;Smooth transitions and mobile-friendly controls.&lt;/li&gt;
&lt;li&gt;Designed for clarity and accessibility.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;⚙️ &lt;strong&gt;Development Tools&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Built with &lt;strong&gt;Vite&lt;/strong&gt; for lightning-fast HMR and builds.&lt;/li&gt;
&lt;li&gt;Code is modular and scalable with &lt;strong&gt;TypeScript&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Uses &lt;strong&gt;ESLint&lt;/strong&gt; and &lt;strong&gt;Prettier&lt;/strong&gt; for clean, consistent code.&lt;/li&gt;
&lt;li&gt;Icon support with &lt;strong&gt;Lucide React Icons&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;📦 &lt;strong&gt;Tech Stack&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;React…&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/rajdhokai/maze-robot-game" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvqprg1dl09iss3doe0ya.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%2Fvqprg1dl09iss3doe0ya.png" alt="Maze Robot Game Start Screen"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7mu7efkhj78a9x1z2qfm.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%2F7mu7efkhj78a9x1z2qfm.png" alt="Robot successfully reaching the maze goal"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  ☁️ Alibaba Cloud Services Implementation
&lt;/h2&gt;

&lt;h3&gt;
  
  
  ✅ Object Storage Service (OSS)
&lt;/h3&gt;

&lt;p&gt;OSS is ideal for hosting static sites. It’s fast, globally available, and straightforward to use.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How I used it:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Built the game using &lt;code&gt;npm run build&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Uploaded the output files directly to an OSS bucket.&lt;/li&gt;
&lt;li&gt;Enabled &lt;strong&gt;Static Website Hosting&lt;/strong&gt; on the bucket.&lt;/li&gt;
&lt;li&gt;Set &lt;code&gt;index.html&lt;/code&gt; as the default entry file.&lt;/li&gt;
&lt;li&gt;Used an &lt;strong&gt;OSS-Accelerate endpoint&lt;/strong&gt; for improved global performance.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;ul&gt;
&lt;li&gt;🌍 Extremely fast and low-latency static asset delivery&lt;/li&gt;
&lt;li&gt;🧾 No server management or backend configuration required&lt;/li&gt;
&lt;li&gt;🛠️ Easy setup and integration through the Alibaba Cloud Console&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  ⚠️ Challenges
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;🔒 Regional restriction for some core services (like ECS), but OSS worked perfectly as a workaround.&lt;/li&gt;
&lt;li&gt;📘 Slight learning curve around bucket policies and safely enabling public access.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  🎮 Game Development Highlights
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;🔁 &lt;strong&gt;Dynamic Maze Logic&lt;/strong&gt;: The maze is built with a scalable structure allowing for future upgrades like procedural generation or different difficulty levels.&lt;/li&gt;
&lt;li&gt;🎯 &lt;strong&gt;Grid-Based Movement&lt;/strong&gt;: The robot moves within a constrained grid, allowing intuitive navigation and potential for future pathfinding algorithms.&lt;/li&gt;
&lt;li&gt;⚡ &lt;strong&gt;Built with Vite&lt;/strong&gt;: Super-fast development and hot module replacement made the build process smooth and efficient.&lt;/li&gt;
&lt;li&gt;🧩 &lt;strong&gt;Component-Based Structure&lt;/strong&gt;: The project is organized into clean, reusable components, making it easy to maintain and expand.&lt;/li&gt;
&lt;li&gt;🎨 &lt;strong&gt;Tailwind-Powered Design&lt;/strong&gt;: Quick UI styling with Tailwind enabled responsive layout and a polished interface with minimal effort.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>alibabachallenge</category>
      <category>devchallenge</category>
      <category>gamedev</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Building a Stunning Admin Panel with React &amp; KendoReact</title>
      <dc:creator>Dhokai Raj </dc:creator>
      <pubDate>Mon, 24 Mar 2025 06:33:04 +0000</pubDate>
      <link>https://dev.to/rajdhokai/building-a-stunning-admin-panel-with-react-kendoreact-dpa</link>
      <guid>https://dev.to/rajdhokai/building-a-stunning-admin-panel-with-react-kendoreact-dpa</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/kendoreact"&gt;KendoReact Free Components Challenge&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Here are the answers based on your &lt;strong&gt;Admin Dashboard - React &amp;amp; KendoReact&lt;/strong&gt; project:  &lt;/p&gt;




&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;I created an &lt;strong&gt;Admin Dashboard&lt;/strong&gt; using &lt;strong&gt;React&lt;/strong&gt; and &lt;strong&gt;KendoReact Free Components&lt;/strong&gt; to manage and display various data points efficiently. This dashboard provides a seamless UI for handling tasks such as data visualization, form inputs, notifications, and layout management.  &lt;/p&gt;

&lt;p&gt;The application features multiple sections, including a &lt;strong&gt;data grid for tabular data&lt;/strong&gt;, &lt;strong&gt;charts for insights&lt;/strong&gt;, &lt;strong&gt;input fields for user interactions&lt;/strong&gt;, and a &lt;strong&gt;notification system&lt;/strong&gt; for updates. This project showcases how KendoReact components can be integrated to build a modern and interactive admin panel.   &lt;/p&gt;

&lt;h3&gt;
  
  
  Demo
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://admin-dashboard-react-kendo-react.vercel.app/" rel="noopener noreferrer"&gt;Live Demo&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/rajdhokai" rel="noopener noreferrer"&gt;
        rajdhokai
      &lt;/a&gt; / &lt;a href="https://github.com/rajdhokai/Admin-Dashboard-React-KendoReact" rel="noopener noreferrer"&gt;
        Admin-Dashboard-React-KendoReact
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      A fully responsive Admin Dashboard built using React and KendoReact components. This dashboard includes powerful UI elements like tables, charts, forms, notifications, progress bars, and more. It provides an intuitive and efficient interface for managing data with sorting, filtering, and exporting features.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;🚀 Admin Dashboard - React &amp;amp; KendoReact&lt;/h1&gt;
&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;📌 Overview&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;A fully responsive &lt;strong&gt;Admin Dashboard&lt;/strong&gt; built using &lt;strong&gt;React&lt;/strong&gt; and &lt;strong&gt;KendoReact&lt;/strong&gt; components. This dashboard provides an intuitive and efficient interface for managing data with powerful UI elements such as &lt;strong&gt;tables, charts, forms, notifications, progress bars, and more&lt;/strong&gt;.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;✨ Features&lt;/h2&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Dynamic Data Grid&lt;/strong&gt; with sorting, filtering, and exporting&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Interactive Charts &amp;amp; Gauges&lt;/strong&gt; for data visualization&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Customizable Forms&lt;/strong&gt; with validation&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Date Pickers &amp;amp; Dropdowns&lt;/strong&gt; for user-friendly input&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Excel Export Functionality&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Notifications &amp;amp; Alerts&lt;/strong&gt; for real-time updates&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Fully Responsive Design&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Local Storage Integration&lt;/strong&gt; for managing blog data (Add, Edit, Delete)&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;🛠️ Technologies Used&lt;/h2&gt;

&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;React 18&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;KendoReact Components&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Lucide Icons&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;React Router DOM&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tailwind CSS&lt;/strong&gt; (for styling)&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;📦 Installation&lt;/h2&gt;

&lt;/div&gt;
&lt;div class="highlight highlight-source-shell notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;&lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt; Clone the repository&lt;/span&gt;
git clone https://github.com/rajdhokai/admin-dashboard.git

&lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt; Navigate to the project directory&lt;/span&gt;
&lt;span class="pl-c1"&gt;cd&lt;/span&gt; admin-dashboard

&lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt; Install dependencies&lt;/span&gt;
npm install

&lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt; Start the development server&lt;/span&gt;
npm start&lt;/pre&gt;

&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;📖 Usage&lt;/h2&gt;

&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;Navigate to &lt;code&gt;http://localhost:3000/&lt;/code&gt; in your browser.&lt;/li&gt;
&lt;li&gt;Manage…&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/rajdhokai/Admin-Dashboard-React-KendoReact" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;h2&gt;
  
  
  KendoReact Experience
&lt;/h2&gt;

&lt;p&gt;To build this project, I leveraged &lt;strong&gt;12 KendoReact Free Components&lt;/strong&gt;, making full use of their powerful features. Here’s how I incorporated them:  &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;KendoReact Grid&lt;/strong&gt; – Displays structured data in a table with sorting and filtering options.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;KendoReact Buttons&lt;/strong&gt; – Used for user actions like saving data or navigating between pages.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;KendoReact Charts&lt;/strong&gt; – Visualizes key metrics and trends in an interactive manner.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;KendoReact Dropdowns&lt;/strong&gt; – Provides user-friendly selection menus.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;KendoReact Form&lt;/strong&gt; – Handles user inputs and form submissions efficiently.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;KendoReact Progress Bars&lt;/strong&gt; – Shows loading states and completion levels dynamically.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;KendoReact Date Inputs&lt;/strong&gt; – Enables date selection for reports and logs.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;KendoReact Layout&lt;/strong&gt; – Structures the dashboard layout with a professional look.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;KendoReact ListView&lt;/strong&gt; – Displays lists of items in a clean format.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;KendoReact TreeView&lt;/strong&gt; – Organizes hierarchical data, improving navigation.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;KendoReact Notification&lt;/strong&gt; – Provides real-time alerts and messages.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;KendoReact Animation&lt;/strong&gt; – Enhances UI interactions with smooth animations.
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;By integrating these components, I was able to build a &lt;strong&gt;responsive&lt;/strong&gt;, &lt;strong&gt;user-friendly&lt;/strong&gt;, and &lt;strong&gt;feature-rich admin dashboard&lt;/strong&gt;. &lt;/p&gt;

&lt;h3&gt;
  
  
  AIm to Impress
&lt;/h3&gt;

&lt;h3&gt;
  
  
  Delightfully Designed
&lt;/h3&gt;

</description>
      <category>devchallenge</category>
      <category>kendoreactchallenge</category>
      <category>react</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Meme Maker Powered by Pinata: Secure File Storage Meets Real-Time Customization</title>
      <dc:creator>Dhokai Raj </dc:creator>
      <pubDate>Sun, 13 Oct 2024 15:06:25 +0000</pubDate>
      <link>https://dev.to/rajdhokai/meme-maker-powered-by-pinata-secure-file-storage-meets-real-time-customization-gdn</link>
      <guid>https://dev.to/rajdhokai/meme-maker-powered-by-pinata-secure-file-storage-meets-real-time-customization-gdn</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/pinata"&gt;The Pinata Challenge &lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;What I Built&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;I built a &lt;strong&gt;Meme Generator Web Application&lt;/strong&gt; where users can upload images, add custom text, and download their memes. This app leverages &lt;strong&gt;Pinata&lt;/strong&gt; to store images on the &lt;strong&gt;InterPlanetary File System (IPFS)&lt;/strong&gt;, ensuring the meme images are securely stored in a decentralized manner and retrievable with a persistent CID (Content Identifier). The app includes flexible options for text styling, positioning, and a smooth user interface for generating and downloading memes in real-time.&lt;/p&gt;

&lt;h2&gt;
  
  
  My Code
&lt;/h2&gt;

&lt;p&gt;Demo Link : &lt;a href="https://meme-generator-sigma-khaki.vercel.app/" rel="noopener noreferrer"&gt;Click Here&lt;/a&gt;&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/rajdhokai" rel="noopener noreferrer"&gt;
        rajdhokai
      &lt;/a&gt; / &lt;a href="https://github.com/rajdhokai/meme-generator" rel="noopener noreferrer"&gt;
        meme-generator
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;&lt;strong&gt;Meme Generator with Pinata and React (Vite)&lt;/strong&gt;&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;This project is a &lt;strong&gt;Meme Generator&lt;/strong&gt; built with React (using Vite as the build tool) and integrated with &lt;strong&gt;Pinata&lt;/strong&gt; for decentralized image upload and retrieval via &lt;strong&gt;IPFS&lt;/strong&gt;. The app allows users to upload an image, add customizable text on it, and download the generated meme.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;&lt;strong&gt;Features&lt;/strong&gt;&lt;/h2&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;Upload an image to IPFS using Pinata.&lt;/li&gt;
&lt;li&gt;Add customizable top and bottom text to the uploaded image.&lt;/li&gt;
&lt;li&gt;Adjust font style, size, text color, and text position.&lt;/li&gt;
&lt;li&gt;Download the final meme as a PNG.&lt;/li&gt;
&lt;li&gt;The image is stored securely on IPFS using Pinata's gateway, with the option to refresh the image URL periodically.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;&lt;strong&gt;Tech Stack&lt;/strong&gt;&lt;/h2&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Frontend&lt;/strong&gt;: React with TypeScript&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Build Tool&lt;/strong&gt;: Vite&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Storage&lt;/strong&gt;: Pinata (IPFS)&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;&lt;strong&gt;Getting Started&lt;/strong&gt;&lt;/h2&gt;

&lt;/div&gt;
&lt;p&gt;Follow the steps below to run the project locally:&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;&lt;strong&gt;Prerequisites&lt;/strong&gt;&lt;/h3&gt;

&lt;/div&gt;
&lt;p&gt;Make sure you have the following installed:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://nodejs.org/" rel="nofollow noopener noreferrer"&gt;Node.js&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.pinata.cloud/" rel="nofollow noopener noreferrer"&gt;Pinata Account&lt;/a&gt; (for the API keys)&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;&lt;strong&gt;1. Clone the&lt;/strong&gt;&lt;/h3&gt;…&lt;/div&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/rajdhokai/meme-generator" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe0voptlql264fccpvjqi.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%2Fe0voptlql264fccpvjqi.png" alt="Image description" width="750" height="1000"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;More Details&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Pinata for Decentralized File Storage:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;File Upload:&lt;/strong&gt; Users select an image file, which is uploaded to &lt;strong&gt;Pinata’s IPFS gateway&lt;/strong&gt; using Pinata’s API (&lt;code&gt;pinata.upload.file&lt;/code&gt;). This securely pins the image file on IPFS, allowing the image to be publicly accessible across decentralized storage.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Storing and Accessing the Image:&lt;/strong&gt; After a successful upload, Pinata provides a &lt;strong&gt;CID&lt;/strong&gt; (unique identifier for the uploaded content). This CID is used to retrieve the image from IPFS, ensuring that it remains permanently available across the decentralized web. By leveraging this CID, the app fetches the image for further processing.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2. Signed URL Generation with Pinata:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;To ensure a smooth and secure experience for users, I implemented a mechanism to generate &lt;strong&gt;signed URLs&lt;/strong&gt; using Pinata’s API. Signed URLs are time-limited URLs that allow images to be accessed without exposing raw IPFS links. This helps mitigate issues like content tampering or unauthorized access.&lt;/li&gt;
&lt;li&gt;The app &lt;strong&gt;automatically refreshes the signed URL&lt;/strong&gt; every few minutes (using a refresh interval) to prevent expiration. This ensures that the user’s uploaded image remains accessible while they are working on creating their meme.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;3. Real-Time Meme Creation:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Once an image is uploaded, it is loaded onto a &lt;strong&gt;canvas element&lt;/strong&gt; where users can add &lt;strong&gt;top and bottom text&lt;/strong&gt;. The app provides several customization options:

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Font Style &amp;amp; Size:&lt;/strong&gt; Users can choose from multiple popular font styles (like Impact, Arial, Comic Sans, etc.) and adjust the font size.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Text Color &amp;amp; Positioning:&lt;/strong&gt; Users can choose the text color and control the X and Y positioning of both the top and bottom text. This flexibility makes it easy to position text dynamically over any image.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;The app draws the text on the canvas in real-time using &lt;strong&gt;HTML5 Canvas API&lt;/strong&gt;, and any changes made (such as font adjustments or text edits) are immediately reflected on the image.&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;4. Error Handling and Smooth User Experience:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Error Messaging:&lt;/strong&gt; If the image upload or signed URL generation fails, users receive a clear error message, and they can refresh the signed URL manually to resolve the issue.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Loading States:&lt;/strong&gt; When an image is being uploaded to Pinata or while retrieving the signed URL, a loading indicator (&lt;code&gt;Loader&lt;/code&gt; component) ensures that users are aware of ongoing processes, improving the overall experience.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;5. Meme Downloading:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Once the meme is fully customized, users can &lt;strong&gt;download their meme&lt;/strong&gt; as a PNG file. The canvas is converted into a blob, which is then downloaded using a simple click on the "Download Meme" button. This provides an easy way for users to share their creations or keep them locally.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;6. Responsive UI/UX:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The interface is designed to be user-friendly and responsive, with &lt;strong&gt;Tailwind CSS&lt;/strong&gt; used for styling. The form elements, buttons, and canvas work well across different screen sizes, ensuring a good experience for both desktop and mobile users.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Pinata’s Role in the Project:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Secure &amp;amp; Decentralized Storage:&lt;/strong&gt; Using Pinata ensures that all uploaded images are securely pinned on a decentralized storage network, guaranteeing persistence and availability.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Efficient Retrieval:&lt;/strong&gt; The ability to generate and refresh signed URLs using Pinata’s API allows for secure access and retrieval of images from IPFS, maintaining security without compromising functionality.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Decentralized Web Ready:&lt;/strong&gt; By using Pinata and IPFS, the project moves toward embracing decentralized technology, reducing reliance on centralized servers for file storage, and ensuring more ownership of content by the users.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This combination of &lt;strong&gt;IPFS-powered storage, real-time meme editing,&lt;/strong&gt; and &lt;strong&gt;customizability&lt;/strong&gt; makes the app a fun and efficient tool for creating memes while demonstrating how decentralized storage can be integrated into everyday web applications.&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>pinatachallenge</category>
      <category>webdev</category>
      <category>api</category>
    </item>
    <item>
      <title>Nylas AI-Driven Email Summarizer and Actionable Insights Generator</title>
      <dc:creator>Dhokai Raj </dc:creator>
      <pubDate>Sun, 01 Sep 2024 12:14:07 +0000</pubDate>
      <link>https://dev.to/rajdhokai/nylas-ai-driven-email-summarizer-and-actionable-insights-generator-47n3</link>
      <guid>https://dev.to/rajdhokai/nylas-ai-driven-email-summarizer-and-actionable-insights-generator-47n3</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/nylas"&gt;Nylas Challenge&lt;/a&gt;: AI Expedition.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built and Why
&lt;/h2&gt;

&lt;p&gt;I developed an "Email Summarizer and Actionable Insights Generator." This tool is designed to streamline the often overwhelming task of managing lengthy email threads by automatically summarizing them and extracting actionable items such as deadlines, tasks, and key points. These insights are then organized into a to-do list or calendar events, making it easier to stay on top of important tasks without getting lost in a sea of emails.&lt;/p&gt;

&lt;p&gt;The motivation behind this project stems from the daily challenge many of us face—dealing with information overload. Emails are a vital communication tool, but they can quickly become a source of stress when important details get buried in long threads. By leveraging AI, this tool helps users focus on what truly matters, saving time and reducing cognitive load. Additionally, the integration with Nylas allows for seamless access and analysis of email content, making the solution both powerful and user-friendly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjbpsapdbt5036hcj08qh.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%2Fjbpsapdbt5036hcj08qh.png" alt="Image description" width="800" height="380"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo7yvf9bjapplxd1dnoes.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%2Fo7yvf9bjapplxd1dnoes.png" alt="Image description" width="800" height="330"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx4v41pd7y8y7np74lpl7.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%2Fx4v41pd7y8y7np74lpl7.png" alt="Image description" width="800" height="461"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/rajdhokai" rel="noopener noreferrer"&gt;
        rajdhokai
      &lt;/a&gt; / &lt;a href="https://github.com/rajdhokai/email-summarizer" rel="noopener noreferrer"&gt;
        email-summarizer
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Email Summarizer and Actionable Insights Generator&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;This project is designed to simplify email management by summarizing long email threads and extracting actionable items such as deadlines, tasks, and key points. The extracted insights are then organized into a to-do list or calendar events.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Features&lt;/h2&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Email Summarization:&lt;/strong&gt; Automatically summarize long email threads.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Actionable Insights:&lt;/strong&gt; Extract key points, tasks, and deadlines from emails.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Integration with Nylas:&lt;/strong&gt; Access and analyze email content from various providers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AI-Powered:&lt;/strong&gt; Uses OpenAI and Google Gemini (optional) for natural language processing.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Prerequisites&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;Before you start, make sure you have the following installed:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Node.js&lt;/strong&gt;: &lt;a href="https://nodejs.org/" rel="nofollow noopener noreferrer"&gt;Download and install Node.js&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;NPM&lt;/strong&gt;: Comes with Node.js, used for managing project dependencies.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Git&lt;/strong&gt;: &lt;a href="https://git-scm.com/" rel="nofollow noopener noreferrer"&gt;Download and install Git&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Environment Setup&lt;/h2&gt;

&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Clone the Repository&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Clone the project repository to your local machine using Git:&lt;/p&gt;
&lt;div class="highlight highlight-source-shell notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;git clone https://github.com/your-username/email-summarizer.git
&lt;span class="pl-c1"&gt;cd&lt;/span&gt; email-summarizer&lt;/pre&gt;

&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Install Dependencies&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Navigate to the project directory and install the required Node.js packages:&lt;/p&gt;
&lt;div class="highlight highlight-source-shell notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;npm&lt;/pre&gt;…
&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/rajdhokai/email-summarizer" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;h2&gt;
  
  
  Your Journey
&lt;/h2&gt;

&lt;p&gt;In building this project, I leveraged the Nylas API to access and manage email data, which was a crucial component of the application. The Nylas API made it easy to fetch email threads and provided the flexibility to interact with different types of email content, whether from Gmail, Outlook, or other providers.&lt;/p&gt;

&lt;p&gt;The process of integrating Nylas with OpenAI and Google Gemini was both challenging and rewarding. I learned a lot about combining different APIs to create a cohesive and functional product. The most exciting part was seeing how AI could be applied to real-world problems, transforming chaotic email threads into actionable insights.&lt;/p&gt;

&lt;p&gt;I’m most proud of the seamless user experience the tool provides. Despite the complexity of the backend operations, users can simply fetch their emails, view summaries, and immediately act on the extracted items. This project not only showcases the power of AI but also highlights how Nylas can be used to build solutions that enhance productivity and efficiency in everyday tasks.&lt;/p&gt;

&lt;p&gt;Overall, this project was a significant learning experience and a testament to the capabilities of modern APIs in solving real-world challenges.&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>nylaschallenge</category>
      <category>api</category>
      <category>ai</category>
    </item>
    <item>
      <title>Snake Game Build Better on Stellar: Smart Contract Challenge</title>
      <dc:creator>Dhokai Raj </dc:creator>
      <pubDate>Sun, 18 Aug 2024 21:01:24 +0000</pubDate>
      <link>https://dev.to/rajdhokai/snack-game-build-better-on-stellar-smart-contract-challenge-4b9l</link>
      <guid>https://dev.to/rajdhokai/snack-game-build-better-on-stellar-smart-contract-challenge-4b9l</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/stellar"&gt;Build Better on Stellar: Smart Contract Challenge &lt;/a&gt;: Build a dApp&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;I created a classic Snake game using React and integrated it with a Stellar smart contract to store player game details. The contract handles essential operations such as adding new players, retrieving player information, updating scores, and even deleting players. This integration with Stellar allows the game to securely and transparently manage player data, including scores and public keys, all on the blockchain.&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://stellar-snake-game.vercel.app/" rel="noopener noreferrer"&gt;https://stellar-snake-game.vercel.app/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foo76go275s1w0910f20w.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%2Foo76go275s1w0910f20w.png" alt="Image description" width="800" height="376"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftl5rph40g36l4d7hhokl.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%2Ftl5rph40g36l4d7hhokl.png" alt="Image description" width="800" height="377"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  My Code
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/rajdhokai/stellar-snake-game" rel="noopener noreferrer"&gt;https://github.com/rajdhokai/stellar-snake-game&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Journey
&lt;/h2&gt;

&lt;p&gt;The idea behind this project was to blend the nostalgic fun of the Snake game with the modern capabilities of blockchain technology. I wanted to create something that not only provided entertainment but also showcased the potential of decentralized systems for managing game data.&lt;/p&gt;

&lt;p&gt;The design of the smart contract was centered around creating a secure and efficient way to handle player information. I focused on making the contract versatile, allowing for easy addition of new players, updating of scores, and retrieval of all players. The contract also includes functionality for deleting players, ensuring that the game’s data remains clean and manageable.&lt;/p&gt;

&lt;p&gt;Throughout the development process, I learned a lot about the Stellar ecosystem, especially the intricacies of smart contract development with Soroban. It was exciting to see how blockchain technology could be applied to a simple game, providing transparency and security in a fun and engaging way.&lt;/p&gt;

&lt;p&gt;I'm particularly proud of how seamlessly the smart contract integrates with the game, providing real-time updates and secure storage of player data. Next, I hope to explore more complex gaming mechanics and further leverage Stellar's capabilities to create even more immersive blockchain-based games.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Additional Prize Categories: Glorious Game and/or Super Sustainable&lt;/strong&gt;&lt;br&gt;
Given the fun and interactive nature of the Snake game, coupled with the innovative use of blockchain technology, I would like this submission to be considered for the Glorious Game prize category. The combination of a classic game with the power of Stellar's smart contracts creates a unique and engaging experience that stands out in the gaming space.&lt;/p&gt;

&lt;p&gt;Here's how you can invoke the methods of the Stellar smart contract for the snake game using the &lt;code&gt;soroban contract invoke&lt;/code&gt; command. Replace &lt;code&gt;&amp;lt;DEPLOYED_CONTRACT_ADDRESS&amp;gt;&lt;/code&gt; with your actual deployed contract address.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Create a Player
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;soroban contract invoke &lt;span class="nt"&gt;--id&lt;/span&gt; CBGPKZU7CNVUITUZO5SJXMBIMVHZPU2PIOJAM7MBWBPEITKUY2YLEJRB &lt;span class="nt"&gt;--source&lt;/span&gt; alice &lt;span class="nt"&gt;--network&lt;/span&gt; testnet &lt;span class="nt"&gt;--&lt;/span&gt; add_player &lt;span class="nt"&gt;--name&lt;/span&gt; &lt;span class="s2"&gt;"Alice"&lt;/span&gt; &lt;span class="nt"&gt;--public_key&lt;/span&gt; &lt;span class="s2"&gt;"GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWHF"&lt;/span&gt; &lt;span class="nt"&gt;--score&lt;/span&gt; 100
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2. Update a Player's Score
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;soroban contract invoke &lt;span class="nt"&gt;--id&lt;/span&gt; CBGPKZU7CNVUITUZO5SJXMBIMVHZPU2PIOJAM7MBWBPEITKUY2YLEJRB &lt;span class="nt"&gt;--source&lt;/span&gt; alice &lt;span class="nt"&gt;--network&lt;/span&gt; testnet &lt;span class="nt"&gt;--&lt;/span&gt; update_player &lt;span class="nt"&gt;--player_id&lt;/span&gt; 1 &lt;span class="nt"&gt;--new_score&lt;/span&gt; 150
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3. Get Player by ID
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;soroban contract invoke &lt;span class="nt"&gt;--id&lt;/span&gt; CBGPKZU7CNVUITUZO5SJXMBIMVHZPU2PIOJAM7MBWBPEITKUY2YLEJRB &lt;span class="nt"&gt;--source&lt;/span&gt; alice &lt;span class="nt"&gt;--network&lt;/span&gt; testnet &lt;span class="nt"&gt;--&lt;/span&gt; get_player_by_id &lt;span class="nt"&gt;--player_id&lt;/span&gt; 1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  4. Get All Players
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;soroban contract invoke &lt;span class="nt"&gt;--id&lt;/span&gt; CBGPKZU7CNVUITUZO5SJXMBIMVHZPU2PIOJAM7MBWBPEITKUY2YLEJRB &lt;span class="nt"&gt;--source&lt;/span&gt; alice &lt;span class="nt"&gt;--network&lt;/span&gt; testnet &lt;span class="nt"&gt;--&lt;/span&gt; get_all_players
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  5. Delete a Player by ID
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;soroban contract invoke &lt;span class="nt"&gt;--id&lt;/span&gt; CBGPKZU7CNVUITUZO5SJXMBIMVHZPU2PIOJAM7MBWBPEITKUY2YLEJRB &lt;span class="nt"&gt;--source&lt;/span&gt; alice &lt;span class="nt"&gt;--network&lt;/span&gt; testnet &lt;span class="nt"&gt;--&lt;/span&gt; delete_player &lt;span class="nt"&gt;--player_id&lt;/span&gt; 1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Notes:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Replace &lt;code&gt;"GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWHF"&lt;/code&gt; with a valid public key for your player.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;--id&lt;/code&gt; flag represents the ID of the player when updating, retrieving, or deleting specific player data. &lt;/li&gt;
&lt;li&gt;The commands assume that the &lt;code&gt;name&lt;/code&gt;, &lt;code&gt;public_key&lt;/code&gt;, and &lt;code&gt;score&lt;/code&gt; parameters are required to create a new player. Adjust accordingly if your contract implementation differs.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Team:
&lt;/h3&gt;

&lt;p&gt;&lt;a class="mentioned-user" href="https://dev.to/chintanonweb"&gt;@chintanonweb&lt;/a&gt; &lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>stellarchallenge</category>
      <category>blockchain</category>
      <category>web3</category>
    </item>
    <item>
      <title>Exploring React v19: Elevating User Experiences with Concurrent Mode and Suspense</title>
      <dc:creator>Dhokai Raj </dc:creator>
      <pubDate>Mon, 29 Apr 2024 15:44:49 +0000</pubDate>
      <link>https://dev.to/rajdhokai/exploring-react-v19-elevating-user-experiences-with-concurrent-mode-and-suspense-5b8b</link>
      <guid>https://dev.to/rajdhokai/exploring-react-v19-elevating-user-experiences-with-concurrent-mode-and-suspense-5b8b</guid>
      <description>&lt;h1&gt;
  
  
  Exploring the New Features of React v19: A Comprehensive Guide
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;React v19 brings forth a myriad of exciting features, enhancing the developer experience and empowering them to build more efficient and maintainable web applications. In this article, we'll delve into the latest additions to React, providing step-by-step examples and detailed explanations to help you harness the full potential of these enhancements.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Concurrent Mode: What's the Buzz All About?
&lt;/h2&gt;

&lt;h3&gt;
  
  
  What is Concurrent Mode?
&lt;/h3&gt;

&lt;p&gt;React v19 introduces Concurrent Mode, a groundbreaking feature that revolutionizes how React manages rendering priorities. With Concurrent Mode, React can work on multiple tasks simultaneously, allowing for smoother user experiences, particularly in high-load scenarios.&lt;/p&gt;

&lt;h3&gt;
  
  
  How Does Concurrent Mode Benefit Developers?
&lt;/h3&gt;

&lt;p&gt;Concurrent Mode enables developers to prioritize rendering tasks based on their importance, ensuring critical updates are processed promptly while non-essential tasks are deferred. This leads to improved performance, reduced latency, and better responsiveness in React applications.&lt;/p&gt;

&lt;h3&gt;
  
  
  Example: Implementing Concurrent Mode
&lt;/h3&gt;

&lt;p&gt;Let's consider a scenario where a React application needs to fetch data from an API and update the UI accordingly. With Concurrent Mode, we can ensure that the UI remains responsive even while the data is being fetched asynchronously.&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;React&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Suspense&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&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;fetchData&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;return&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;resolve&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;setTimeout&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;resolve&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Data fetched successfully!&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="mi"&gt;2000&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;MyComponent&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="nx"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;fetchData&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;Suspense&lt;/span&gt; &lt;span class="nx"&gt;fallback&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;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Loading&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;/div&amp;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="nx"&gt;div&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;data&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;/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;/Suspense&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;MyComponent&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, the &lt;code&gt;Suspense&lt;/code&gt; component allows us to specify a fallback UI while the data is being fetched. Concurrent Mode ensures that the UI remains responsive during this asynchronous operation.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Server Components: A Paradigm Shift in React Development
&lt;/h2&gt;

&lt;h3&gt;
  
  
  What are Server Components?
&lt;/h3&gt;

&lt;p&gt;Server Components in React v19 introduce a novel approach to building web applications by shifting some of the rendering logic to the server-side. This enables faster initial page loads, improved SEO, and better performance on low-powered devices.&lt;/p&gt;

&lt;h3&gt;
  
  
  How Do Server Components Work?
&lt;/h3&gt;

&lt;p&gt;Server Components are rendered on the server and sent to the client as HTML, reducing the amount of JavaScript required to render the initial page. Subsequent interactions are handled by client-side React components, providing a seamless user experience.&lt;/p&gt;

&lt;h3&gt;
  
  
  Example: Integrating Server Components
&lt;/h3&gt;

&lt;p&gt;Let's see how we can integrate Server Components into a React application to enhance its performance and SEO capabilities.&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="c1"&gt;// ServerComponent.js&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;React&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&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;ServerComponent&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;return&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="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;This&lt;/span&gt; &lt;span class="nx"&gt;content&lt;/span&gt; &lt;span class="nx"&gt;is&lt;/span&gt; &lt;span class="nx"&gt;rendered&lt;/span&gt; &lt;span class="nx"&gt;on&lt;/span&gt; &lt;span class="nx"&gt;the&lt;/span&gt; &lt;span class="nx"&gt;server&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;/div&amp;gt;&lt;/span&gt;&lt;span class="err"&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;ServerComponent&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// ClientComponent.js&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;React&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&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;hydrate&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-dom&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;ServerComponent&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;./ServerComponent&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;ClientComponent&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;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;div&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;ServerComponent&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="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;This&lt;/span&gt; &lt;span class="nx"&gt;content&lt;/span&gt; &lt;span class="nx"&gt;is&lt;/span&gt; &lt;span class="nx"&gt;rendered&lt;/span&gt; &lt;span class="nx"&gt;on&lt;/span&gt; &lt;span class="nx"&gt;the&lt;/span&gt; &lt;span class="nx"&gt;client&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;/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;/div&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="nf"&gt;hydrate&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;ClientComponent&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;root&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;In this example, the &lt;code&gt;ServerComponent&lt;/code&gt; is rendered on the server and sent to the client as HTML, while the &lt;code&gt;ClientComponent&lt;/code&gt; handles subsequent interactions on the client-side.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Improved TypeScript Support: Making Type Checking Easier
&lt;/h2&gt;

&lt;h3&gt;
  
  
  What Enhancements Does React v19 Bring to TypeScript Support?
&lt;/h3&gt;

&lt;p&gt;React v19 enhances TypeScript support by providing better type inference, improved error messages, and enhanced compatibility with popular TypeScript tools and libraries. This simplifies the process of type checking React applications and ensures a smoother development experience for TypeScript users.&lt;/p&gt;

&lt;h3&gt;
  
  
  Example: Leveraging Improved TypeScript Support
&lt;/h3&gt;

&lt;p&gt;Let's leverage the improved TypeScript support in React v19 to build a type-safe React component.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// TypeScriptComponent.tsx&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;React&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&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="nx"&gt;Props&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&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="nx"&gt;TypeScriptComponent&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;FC&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&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="o"&gt;=&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="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&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="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Hello&lt;/span&gt;&lt;span class="p"&gt;,&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="o"&gt;!&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&amp;gt;&lt;/span&gt;&lt;span class="err"&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;TypeScriptComponent&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, the &lt;code&gt;Props&lt;/code&gt; type ensures that the &lt;code&gt;name&lt;/code&gt; prop is of type &lt;code&gt;string&lt;/code&gt;, providing type safety and preventing potential runtime errors.&lt;/p&gt;

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

&lt;p&gt;React v19 introduces a host of new features aimed at improving developer productivity, enhancing performance, and simplifying the development process. From Concurrent Mode and Server Components to improved TypeScript support, these enhancements empower developers to build faster, more reliable, and more maintainable React applications. Stay tuned for further updates and enhancements as React continues to evolve and innovate.&lt;/p&gt;

&lt;h2&gt;
  
  
  Frequently Asked Questions (FAQ)
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Q: Is it necessary to upgrade to React v19 immediately?
&lt;/h3&gt;

&lt;p&gt;A: While React v19 offers exciting new features, the decision to upgrade should be based on your project's requirements and compatibility considerations. It's essential to thoroughly test the upgrade in a development environment before deploying it to production.&lt;/p&gt;

&lt;h3&gt;
  
  
  Q: How can I stay updated on future React releases and developments?
&lt;/h3&gt;

&lt;p&gt;A: You can stay updated on future React releases by following the official React blog, subscribing to the React newsletter, and participating in the React community forums and events.&lt;/p&gt;

&lt;h3&gt;
  
  
  Q: Are there any backward compatibility issues with React v19?
&lt;/h3&gt;

&lt;p&gt;A: React v19 strives to maintain backward compatibility with previous versions, but it's always recommended to review the official release notes and documentation for any potential breaking changes or deprecated features before upgrading.&lt;/p&gt;

&lt;h3&gt;
  
  
  Q: Can I use Concurrent Mode and Server Components together in the same application?
&lt;/h3&gt;

&lt;p&gt;A: Yes, Concurrent Mode and Server Components are designed to work together seamlessly, providing developers with greater flexibility and scalability in building modern React applications.&lt;/p&gt;

&lt;h3&gt;
  
  
  Q: Does React v19 offer any performance improvements over previous versions?
&lt;/h3&gt;

&lt;p&gt;A: Yes, React v19 introduces several performance optimizations, such as Concurrent Mode and Server Components, aimed at improving rendering efficiency and reducing latency in React applications.&lt;/p&gt;

&lt;p&gt;This comprehensive guide provides a detailed overview of the new features in React v19, along with step-by-step examples and explanations to help you harness their full potential. Whether you're a seasoned React developer or just getting started, these enhancements are sure to elevate your web development experience.&lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>programming</category>
    </item>
    <item>
      <title>Maximizing React: The Ultimate Guide to Performance Enhancement</title>
      <dc:creator>Dhokai Raj </dc:creator>
      <pubDate>Fri, 26 Apr 2024 16:36:52 +0000</pubDate>
      <link>https://dev.to/rajdhokai/maximizing-react-the-ultimate-guide-to-performance-enhancement-4e9p</link>
      <guid>https://dev.to/rajdhokai/maximizing-react-the-ultimate-guide-to-performance-enhancement-4e9p</guid>
      <description>&lt;h1&gt;
  
  
  The Ultimate Guide to React Performance Optimization API: Boosting Your App's Speed and Efficiency
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Are you struggling with sluggish React applications? Is your user experience suffering due to slow loading times and unresponsive UI components? Fear not, as React Performance Optimization API is here to rescue! In this comprehensive guide, we will delve into the depths of React's performance optimization techniques, step by step, to help you enhance your app's speed and efficiency. From identifying bottlenecks to implementing efficient solutions, we've got you covered.&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding the Need for Performance Optimization
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Why is performance optimization crucial for React apps?
&lt;/h3&gt;

&lt;p&gt;Performance optimization is not just about making your app faster; it's about delivering a seamless user experience. In today's fast-paced digital world, users have little patience for sluggish interfaces. Every second counts, and a delay of even a few milliseconds can lead to user frustration and abandonment. By optimizing your React app's performance, you can ensure smoother interactions, faster loading times, and happier users.&lt;/p&gt;

&lt;h2&gt;
  
  
  Identifying Performance Bottlenecks
&lt;/h2&gt;

&lt;h3&gt;
  
  
  How do you identify performance bottlenecks in React?
&lt;/h3&gt;

&lt;p&gt;Before diving into optimization techniques, it's essential to pinpoint the areas of your app that are causing performance issues. This can be achieved through profiling and monitoring tools such as React DevTools and Chrome DevTools. These tools allow you to analyze component render times, identify inefficient rendering patterns, and detect unnecessary re-renders. By understanding where your app is spending its resources, you can prioritize optimization efforts effectively.&lt;/p&gt;

&lt;h2&gt;
  
  
  Leveraging React Performance Optimization API
&lt;/h2&gt;

&lt;h3&gt;
  
  
  What is React Performance Optimization API, and how does it work?
&lt;/h3&gt;

&lt;p&gt;React Performance Optimization API is a set of tools and techniques provided by React to improve the performance of your applications. It includes features such as memoization, lazy loading, and component profiling, all designed to minimize unnecessary work and maximize efficiency. By utilizing these APIs strategically, you can optimize your app's performance without sacrificing functionality or developer experience.&lt;/p&gt;

&lt;h2&gt;
  
  
  Memoization: Boosting Component Rendering
&lt;/h2&gt;

&lt;h3&gt;
  
  
  How can memoization improve component rendering performance?
&lt;/h3&gt;

&lt;p&gt;Memoization is a technique used to optimize expensive function calls by caching the results based on the input arguments. In the context of React, memoization can be applied to functional components using the &lt;code&gt;React.memo&lt;/code&gt; higher-order component or the &lt;code&gt;useMemo&lt;/code&gt; hook. By memoizing components that rely on static props or state, you can prevent unnecessary re-renders and improve overall rendering performance.&lt;/p&gt;

&lt;h2&gt;
  
  
  Lazy Loading: Efficiently Loading Resources
&lt;/h2&gt;

&lt;h3&gt;
  
  
  How does lazy loading help in optimizing resource loading?
&lt;/h3&gt;

&lt;p&gt;Lazy loading is a strategy for deferring the loading of non-essential resources until they are needed. In React, lazy loading can be achieved using the &lt;code&gt;React.lazy&lt;/code&gt; function and the &lt;code&gt;Suspense&lt;/code&gt; component. By dynamically importing components or modules only when they are required, you can reduce the initial bundle size and improve the app's time-to-interactivity. This is especially beneficial for large applications with complex routing and multiple entry points.&lt;/p&gt;

&lt;h2&gt;
  
  
  Component Profiling: Identifying Rendering Bottlenecks
&lt;/h2&gt;

&lt;h3&gt;
  
  
  How can component profiling help in diagnosing rendering bottlenecks?
&lt;/h3&gt;

&lt;p&gt;Component profiling is a built-in feature of React DevTools that allows you to analyze the performance of individual components in your app. By enabling profiling mode and inspecting component renders, updates, and commits, you can identify which components are causing performance bottlenecks. This insight enables you to optimize specific parts of your app for better overall performance.&lt;/p&gt;

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

&lt;p&gt;In conclusion, optimizing the performance of your React applications is essential for delivering a fast and responsive user experience. By leveraging the React Performance Optimization API and employing techniques such as memoization, lazy loading, and component profiling, you can significantly improve your app's speed and efficiency. Remember to identify performance bottlenecks, prioritize optimization efforts, and continuously monitor and fine-tune your app for optimal performance. With the right tools and techniques, you can take your React apps to the next level and delight your users with lightning-fast performance.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Q: Is React Performance Optimization API suitable for all types of React applications?
&lt;/h3&gt;

&lt;p&gt;A: Yes, React Performance Optimization API can be applied to a wide range of React applications, from small single-page apps to large enterprise-level applications. However, the specific optimization techniques may vary depending on the size and complexity of the application.&lt;/p&gt;

&lt;h3&gt;
  
  
  Q: How do I measure the effectiveness of performance optimization efforts?
&lt;/h3&gt;

&lt;p&gt;A: The effectiveness of performance optimization efforts can be measured using various metrics such as page load time, time to interactive, and rendering performance. Profiling and monitoring tools such as React DevTools and Chrome DevTools can provide valuable insights into the impact of optimization techniques on your app's performance.&lt;/p&gt;

&lt;h3&gt;
  
  
  Q: Are there any downsides to using lazy loading in React applications?
&lt;/h3&gt;

&lt;p&gt;A: While lazy loading can significantly improve initial load times and reduce bundle size, it may also introduce additional complexity, especially in applications with complex routing and dynamic imports. Careful planning and implementation are necessary to ensure a smooth user experience without compromising on code maintainability.&lt;/p&gt;

&lt;p&gt;This comprehensive guide should equip you with the knowledge and tools needed to optimize the performance of your React applications effectively. Remember, performance optimization is an ongoing process, so don't hesitate to experiment with different techniques and continuously monitor your app's performance for further improvements. Happy optimizing!&lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Dive Deep into useContext: Simplify State Sharing in React</title>
      <dc:creator>Dhokai Raj </dc:creator>
      <pubDate>Fri, 26 Apr 2024 16:17:02 +0000</pubDate>
      <link>https://dev.to/rajdhokai/dive-deep-into-usecontext-simplify-state-sharing-in-react-45li</link>
      <guid>https://dev.to/rajdhokai/dive-deep-into-usecontext-simplify-state-sharing-in-react-45li</guid>
      <description>&lt;h1&gt;
  
  
  The Ultimate Guide to React Hooks: useContext
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;In the world of React development, staying ahead of the curve is crucial. With the introduction of React Hooks, developers have been empowered with a more concise and intuitive way to manage state and side effects in functional components. One such hook, &lt;code&gt;useContext&lt;/code&gt;, revolutionizes how components can consume context without the need for prop drilling. In this comprehensive guide, we delve into the intricacies of &lt;code&gt;useContext&lt;/code&gt;, offering step-by-step examples and detailed explanations to help you master this powerful hook.&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding useContext
&lt;/h2&gt;

&lt;h3&gt;
  
  
  What is useContext and why is it important?
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;useContext&lt;/code&gt; is a React Hook that allows functional components to consume context, providing a more elegant solution to prop drilling. Context in React is a mechanism for passing data through the component tree without having to pass props down manually at every level. Prior to Hooks, consuming context in functional components required the use of the &lt;code&gt;Context.Consumer&lt;/code&gt; component or higher-order components. However, &lt;code&gt;useContext&lt;/code&gt; simplifies this process by providing a straightforward way to access context within functional components.&lt;/p&gt;

&lt;h3&gt;
  
  
  How does useContext work?
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;useContext&lt;/code&gt; accepts a context object created by &lt;code&gt;React.createContext()&lt;/code&gt; and returns the current context value for that context. When the context value changes, the component will re-render. This allows components to subscribe to context changes and update accordingly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Implementing useContext
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Step-by-step guide to using useContext
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Create a context&lt;/strong&gt;: Begin by creating a context using &lt;code&gt;React.createContext()&lt;/code&gt;. This creates a context object that will be used to pass data to consuming components.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;React&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&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;MyContext&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createContext&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Provide the context value&lt;/strong&gt;: Wrap your application or a part of it with a &lt;code&gt;Provider&lt;/code&gt; component to provide the context value to all consuming components.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&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="nx"&gt;value&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="cm"&gt;/* Your context data */&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="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;MyContext&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Provider&lt;/span&gt; &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="cm"&gt;/* Your components */&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;MyContext&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Provider&lt;/span&gt;&lt;span class="p"&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;ol&gt;
&lt;li&gt;
&lt;strong&gt;Consume the context&lt;/strong&gt;: Inside any functional component that needs to access the context, use the &lt;code&gt;useContext&lt;/code&gt; hook.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useContext&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&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;MyComponent&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="nx"&gt;context&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useContext&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;MyContext&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="c1"&gt;// Use context here&lt;/span&gt;

  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="cm"&gt;/* JSX */&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;
  
  
  Example: Using useContext in a real-world scenario
&lt;/h3&gt;

&lt;p&gt;Let's consider a scenario where we have a theme context that stores the current theme of our application.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="c1"&gt;// ThemeContext.js&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;React&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&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;ThemeContext&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createContext&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;ThemeProvider&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;children&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;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="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;useState&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="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="nf"&gt;setTheme&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="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="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="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;ThemeContext&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Provider&lt;/span&gt; &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&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;toggleTheme&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;children&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;ThemeContext&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Provider&lt;/span&gt;&lt;span class="p"&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;ThemeContext&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In our &lt;code&gt;App&lt;/code&gt; component, we wrap our application with the &lt;code&gt;ThemeProvider&lt;/code&gt; to provide the theme context.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="c1"&gt;// App.js&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;React&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&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;ThemeProvider&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;./ThemeContext&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;MyComponent&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;./MyComponent&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="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;ThemeProvider&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;MyComponent&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;ThemeProvider&lt;/span&gt;&lt;span class="p"&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;And in our &lt;code&gt;MyComponent&lt;/code&gt;, we can now consume the theme context using &lt;code&gt;useContext&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="c1"&gt;// MyComponent.js&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useContext&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&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;ThemeContext&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;./ThemeContext&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;MyComponent&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;toggleTheme&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useContext&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ThemeContext&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="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Current Theme: &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;theme&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;button&lt;/span&gt; &lt;span class="na"&gt;onClick&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;toggleTheme&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Toggle Theme&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;button&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&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;MyComponent&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  FAQs
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Q: Can I use multiple contexts in a single component?
&lt;/h3&gt;

&lt;p&gt;A: Yes, you can use multiple &lt;code&gt;useContext&lt;/code&gt; calls in a single component to consume multiple contexts.&lt;/p&gt;

&lt;h3&gt;
  
  
  Q: Is useContext a replacement for Redux?
&lt;/h3&gt;

&lt;p&gt;A: While useContext can handle some of the same use cases as Redux, it is not a direct replacement. Redux offers additional features such as a global store and middleware that useContext does not provide.&lt;/p&gt;

&lt;h3&gt;
  
  
  Q: How does useContext compare to prop drilling?
&lt;/h3&gt;

&lt;p&gt;A: Prop drilling involves passing props through multiple levels of components, which can become cumbersome and difficult to maintain. useContext provides a cleaner solution by allowing components to directly access context without the need for props.&lt;/p&gt;

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

&lt;p&gt;In conclusion, &lt;code&gt;useContext&lt;/code&gt; is a powerful tool in the React developer's arsenal, offering a simpler and more elegant solution to consuming context in functional components. By following the steps outlined in this guide and experimenting with real-world examples, you'll be well on your way to harnessing the full potential of &lt;code&gt;useContext&lt;/code&gt; in your React applications.&lt;/p&gt;

&lt;p&gt;Now, armed with this knowledge, go forth and elevate your React development to new heights with &lt;code&gt;useContext&lt;/code&gt;!&lt;/p&gt;

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