javascript

Sharing UI Components: Copy VS Install

Sharing UI Components: Copy VS Install

In recent years, there's been a noticeable shift in how developers approach UI libraries, moving away from installing entire component libraries via npm packages and toward directly copy-pasting the code into their codebase. This trend has been largely popularized by Shadcn/UI, a library that provides developers with ready-made, customizable components that can be copied directly into a project for maximum flexibility. Why Copying Wins for Complex Components The copy-paste approach shines, particularly for complex UI elements such as authentication pages, detailed dashboards, or intricate data visualizations. These components require fine-tuned customization that’s difficult to achieve through immutable npm packages. Instead…
Read More
useReducer and how it is different from useState

useReducer and how it is different from useState

Table of Contents Introduction When to Use useState When to Use useReducer Example 1: Counter App with useState Example 2: Counter App with useReducer Example 3: Form Input Handling with useReducer Example 4: Building a quiz app with useReducer Comparison Between useState and useReducer Conclusion React offers two key hooks for managing state: useState and useReducer. While both are designed to handle state in functional components, they are used in different scenarios. This article explores the differences between the two and highlights when you should use each, with examples for better understanding useState is a simple and effective hook for…
Read More
Motion Fitness: A gamified fitness community to keep you fit

Motion Fitness: A gamified fitness community to keep you fit

This is a submission for the Wix Studio Challenge: Community Edition. I built a niche fitness community platform to help people workout everyday and keep themselves fit. My Community Platform I made a gamified fitness community for the generation that is very busy and sits mostly in front of computer most of the time. A Community shouldn't just be about discussion, it should help everyone in the community get better at what they are doing. This community I made has commit graph similar to Github, but here we track if you have performed any sort of physical activity every 6…
Read More
WebRTC WHIP & WHEP Tutorial: Build a live Streaming App

WebRTC WHIP & WHEP Tutorial: Build a live Streaming App

This article was originally published on the Metered Blog: WebRTC WHIP & WHEP Tutorial: Build a live Streaming App WHIP (WebRTC-HTTP Ingestion Protocol) and WHEP (WebRTC-HTTP Egress Protocol) are protocols that are designed to streamline signalling in WebRTC with the help of standard HTTP methods Definition of WHIP: WHIP simplifies how client devices send media streams to the server. It replaces the complex signalling mechanism that is required with simple HTTP GET requests, thus making it easier to ingest media into servers Definition of WHEP: WHEP protocol is used for delivering media streams from servers to clients. It uses the…
Read More
Weekly GitHub Project: NewsNow – Elegantly Reading Real-Time Trending News

Weekly GitHub Project: NewsNow – Elegantly Reading Real-Time Trending News

Project Introduction This week, we're introducing NewsNow, a news aggregation platform that allows you to elegantly read real-time trending news. NewsNow quickly aggregates real-time news from multiple data sources, offering a smooth reading experience that helps users easily access the latest trending information. This project supports GitHub OAuth login and uses Cloudflare D1 database to manage and store data. In this guide, I'll walk you through the step-by-step process of deploying this open-source project on Cloudflare Pages. You’ll learn how to set up GitHub OAuth login, configure Cloudflare D1 database, and successfully deploy the project. Deployment Guide 1. Preparation 1.1…
Read More
Next.js 15 : Incremental Static Regeneration (ISR)

Next.js 15 : Incremental Static Regeneration (ISR)

With Incremental Static Regeneration (ISR) Incremental Static Regeneration (ISR) in Next.js provides a powerful approach to combine the best of static and dynamic content. By enabling static content updates without recreating the entire site, ISR allows for a more scalable and efficient way of handling pages. We can significantly reduce server load, handle large volumes of content, and ensure users see up-to-date information without waiting for full regeneration of all pages. We can update static content without recreating the entire site. We can reduce the server load by providing prerendered static pages for most requests.We can process a large number…
Read More
Next.js v15 — Reflecting on Mistakes

Next.js v15 — Reflecting on Mistakes

Hello! This is another article about next.js. And finally, about the new version! Each release is a set of new, interesting, and controversial features. This version will be no exception. However, new version is interesting not so much for its new functionality, but for the change in priorities and organization in next.js. And yes, as you may have guessed from the title, a significant part of this release is valuable for reflecting on previous mistakes. I've been working with next.js since around version 8. All this time I've been watching its development with interest (sometimes not without disappointment). Recently, I've…
Read More
The 4 Most Common Mistakes When Using useState in React

The 4 Most Common Mistakes When Using useState in React

When using useState, you may make mistakes, and these mistakes can sometimes reduce performance. As a result, your application may run inefficiently. If you avoid the common mistakes I'm about to explain, your application will run efficiently and with better performance. If you like my articles, you can buy me a coffee :)Buy me coffee 1. Using a Function to Initialize useState When initializing state with useState, if the initial state is the result of an expensive function, this function will be called on every render. This can severely impact performance, especially if the function involves complex computations. Incorrect usage:…
Read More
Fundamentos de Operadores

Fundamentos de Operadores

Os fundamentos de operadores em programação são essenciais para realizar operações matemáticas, comparações lógicas, manipulação de dados e controle de fluxo dentro de um programa. Vamos aprender eles usando JavaScript? Principais tipos de operadores em JavaScript: 1. Operadores Aritméticos São usados para realizar operações matemáticas entre números. Esses operadores incluem: Adição (+): Soma dois valores. Subtração (-): Subtrai o segundo valor do primeiro. Multiplicação (*): Multiplica dois valores. Divisão (/): Divide o primeiro valor pelo segundo. Módulo (%): Retorna o resto da divisão entre dois valores. Exponenciação (``)**: Eleva o primeiro valor à potência do segundo. Exemplo: let a =…
Read More
What’s New in Next.js 15: Key Updates for Developers

What’s New in Next.js 15: Key Updates for Developers

Next.js 15 just became stable which means we can now use it in production without worrying too much about things not working as expected. If you're on the fence about updating, Next.js 15 brings some major improvements that enhance performance, simplify development workflows, and ensure better compatibility with modern tools like React 19, which is planning on being released soon! Here’s a breakdown of some of the most important changes to take a look at. React 19 Support We’ve all been waiting for React 19 to launch and so has Vercel. With Next.js’s newest release, they ensured it would integrate…
Read More
No widgets found. Go to Widget page and add the widget in Offcanvas Sidebar Widget Area.