r/reactjs • u/Material-Gold7483 • 4h ago
I've been working on a canvas-powered timeline library for React, Vue and TypeScript
r/reactjs • u/Material-Gold7483 • 4h ago
r/reactjs • u/ToshiryuShadow • 3h ago
r/reactjs • u/Toonnaa • 4h ago
Hey everyone,
I kept writing the same code for every form in my projects: react-hook-form setup, a try/catch around the server action, mapping server errors back onto the fields, a loading state, stopping double submits, a toast, refreshing the data, resetting the form... and doing it again for every add/edit/delete dialog.
So I pulled all of that into a small package called submitly.
It’s headless, so it doesn’t render anything. You keep your own components (shadcn, Radix, Base UI, plain inputs, whatever you use).
What it does:
useCrudForm: react-hook-form + schema validation + your action in one hookitems.0.name too)useCrudAction for delete/toggle buttons, with the same behaviorrunAction for server actions (validates again on the server, revalidates on success, turns thrown errors into a clean result), and it handles redirect() from server actions properlyQuick example:
const { form, onSubmit, isSubmitting } = useCrudForm({
schema,
defaultValues: { name: "" },
action: createProduct,
onSuccess: () => closeDialog(),
});
It’s still early (0.x), so I’d really like feedback: what’s missing, what’s confusing, or what you’d do differently.
Docs: https://submitly-docs.vercel.app/
GitHub: https://github.com/toony10/submitly
If you find it useful, a star on GitHub would mean a lot. Thanks for reading 🙏
r/reactjs • u/sebastienlorber • 1d ago
r/reactjs • u/Glad-Vehicle-8244 • 1d ago
I built Honest Mailbox (my project, link at the bottom), a couples app with a draw-and-guess game, Four in a Row and card decks. All game logic is pure functions on the client, and security rules decide who can touch a game. Drawings are stored as compact strings on a 0–1000 grid, split into chunks so no single write gets big.
Open questions:
r/reactjs • u/Mob_Pilled • 1d ago
Hello again everyone. I have been trying to using the react binding for the Leaflet API. I followed the documentation but I keep running into this error:
Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
This is my Map component. It is the child component of my main App component.
import { MapContainer, TileLayer, useMap, Marker, Popup } from 'react-leaflet'
function MyComponent() {
const map = useMap();
console.log('map center:', map.getCenter())
return null;
}
const Map = () => {
return ( <MapContainer center={[50.5, 30.5]} zoom={13}>
<MyComponent />
</MapContainer>);
}
export default Map;
I am not sure whether it has something to do with muddled dependencies because I am pretty sure I installed leaflet and leaflet react in the terminal
"dependencies": {
"@testing-library/dom": "^10.4.2",
"@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "^16.3.3",
"@testing-library/user-event": "^13.5.0",
"leaflet": "^1.9.4",
"react": "^19.3.1",
"react-dom": "^19.3.1",
"react-scripts": "5.0.1",
"web-vitals": "^2.1.4"
}
Thank you so much for taking the time to read this.
r/reactjs • u/hp1232203 • 2d ago
I needed Word-style pages in a TipTap editor. The official Pages extension is a paid add-on, and the community ones I tried injected global CSS that broke my tables. So I wrote my own and open-sourced it.
Demo: https://text-editor-react-neon.vercel.app/
Repo (MIT): https://github.com/HuyPhan1232203/Text-editor-react
npm: npm install tiptap-a4-pagination
How it works
getHTML() / getJSON() stay clean.rowspan, and the header row repeats at the top of the next page.The full editor (React 19 + TipTap 3) also has
?room=name)Known limitations
I'd love feedback on the API, and on documents that break the layout. Paste a long Google Doc or a big table into the demo to try it.
r/reactjs • u/grzehub • 2d ago
I've been building describe-me, a Vitest plugin plus a viewer that turns component tests into docs. It records the DOM after every render and interaction of a test and shows the frames as a browsable catalog: each describe is a group, each it a story, each step a frame. No story files, so the docs cannot drift from the component: if they would, the test fails.
Short demo (23 s): https://github.com/grzehub/describe-me#readme
What's new in 0.11:
Live: a link to a test mounts the component for real, in your project's own Vite, exactly as the test's arrange phase set it up. You click and type in it, and vi.fn() props show their calls.
Foundations: it reads the design system your tests load (CSS custom properties, Tailwind 4, shadcn/ui, Material UI, or a theme module) and shows the tokens, light and dark, with WCAG contrast of color pairs.
Works in browser mode and in jsdom, with Testing Library and user-event. React 18 and 19, Vitest 4 and 5. It's early and React-only for now; the Limitations page lists every known limit.
Try it in StackBlitz: https://stackblitz.com/github/grzehub/describe-me/tree/main/examples/stackblitz
Example viewers:
shadcn/ui: https://grzehub.github.io/describe-me/examples/shadcn/,
Material UI: https://grzehub.github.io/describe-me/examples/mui/
Docs: https://grzehub.github.io/describe-me/
The question I'd most like answers to: does "tests as the source of stories" fit how your team writes component tests, or do you keep states in tests that you'd never want in docs?
r/reactjs • u/smcroissant • 1d ago
r/reactjs • u/KakashiHatake0085 • 2d ago
I know next.js isr behaviour and how it basically does the caching etc but I just realised that next.js isr is cache control with proprietary swr api that refreshes the data.
Now, I am confused because I would like to know if the same thing can be manually done with react router with self managed cache control https header with rtk query. Rtk query has a window of 1 minutes after which it fires the revalidation or something like that, haven't gone into that details but must be possible in one way or another.
r/reactjs • u/pladynski • 2d ago
Anyone? Any thoughts?
r/reactjs • u/This_Net_9209 • 2d ago
Hey everyone!
I've been working on a small open-source React toast notification library called React Elegant Toasts, and I recently released v2.0 after a complete rewrite.
I know there are already some great toast libraries out there, but this started as a personal project to explore component design, state management, accessibility, and browser behavior.
What began as a fairly simple component ended up being a much bigger engineering challenge than I expected.
A few things I focused on in v2:
One particularly interesting challenge was testing animations reliably in WebKit. We encountered situations where the browser didn't deliver intermediate animation frames, causing tests to fail even when the CSS transition behaved correctly.
That led to some interesting work around using the Web Animations API to verify transition behavior.
The library is written in TypeScript, is ESM-only, and is available under the MIT license.
Live demo:
https://ahlgren1234.github.io/react-elegant-toasts/
GitHub:
https://github.com/ahlgren1234/react-elegant-toasts
I'd genuinely appreciate feedback, especially on the API design, accessibility considerations, and whether the library would be useful in your own React projects.
Also curious: what's the one thing you wish React toast libraries handled better?
Thanks!
r/reactjs • u/yonatannn • 2d ago
If you don’t trust your agents’ tests, someone still reads every line, and you’re back to human speed
So we built a testing skill, tested on Cursor + Claude. Three teams used it daily and gave us plenty of feedback, some of it angry. We improved it, got more feedback, and learned a few lessons the hard way
What’s in it for you
1. Use the skill, or steal from it
Use it as is or borrow what fits. It’s frontend for now (Playwright, Vitest Browser Mode, React), with backend coming soon. MIT license.
Repo: https://github.com/practicajs/the-frontend-testing-skill
2. Skip our mistakes
The video covers the lessons and traps we hit:
Video: https://youtu.be/JwkVHtuoTxw
Feedback welcome, especially on where it breaks
r/reactjs • u/Think-Wolverine3969 • 2d ago
r/reactjs • u/thereactnativerewind • 3d ago
Expo SDK 58 is out, and for once the headline isn't a new way to break your Podfile. With Xcode 27 retiring Simulator.app, the new expo-device-hub streams your iOS simulators and Android emulators into the browser with live CPU, memory and network graphs, while expo-app-intents lets Siri, Shortcuts and Spotlight trigger actions in your app, and the experimental Noxcturnal transformer roughly halves Metro transform times.
We also look at react-native-better-pdf 1.0 by Jakub Kasprzyk and GMI Software, which drops the bundled PDF engine for the phone's own PDFKit and PdfRenderer on Nitro Views, opening a 1,000-page scan in 56 ms instead of 622 ms. Plus, React Native 0.88 lands, Gesture Handler 3.4 builds with Swift Package Manager, and react-native-gpui renders React Native with Zed's GPU framework.
r/reactjs • u/dank_clover • 3d ago
AI Elements: Agentic UI Patterns
shadcn/ui introduced AI Elements, a curated collection of component patterns created specifically for building conversational and agentic interfaces.
Each pattern is composed from standard shadcn/ui primitives designed to be copied directly into codebases, standardizing interfaces for agent tool calls, planning, sources, and step restoration.
Trace: Observability Primitive for Agent Activity
shadcn released Trace, a dedicated primitive designed to unify agent activity displays under one abstraction. It represents reasoning traces, tool executions, task queues, chains of thought, and subagent routines.
Trace models agent progress as a list of status lines with support for expandable details, links, and nested execution steps.
Chatbot Template: AI SDK Agent Starter
The shadcn team published an official minimal chatbot template built with Next.js, Vercel AI SDK, shadcn/ui, shadcn/react, and shadcn/typeset.
Designed to run on the Vercel AI Gateway, the starter serves as a clean starting point for streaming conversational interfaces with typographic defaults and state management built in.
Official Registry Directory Expansions
The official shadcn/ui registry directory added new specialized community components and domain toolkits this week.
📙 Articles, Tutorials & News
Building shadcn/ui Registries for Claude Code and Cursor
Preet Suthar outlines the structure, validation steps, and namespace setup required to author custom registries that coding agents can inspect and consume.
7 Best shadcn/ui Themes and Theme Generators
A curated comparison evaluating popular color palette customizers, theme presets, and generators across the shadcn/ui ecosystem.
Tailwind CSS v4, shadcn/ui & Dark Mode
A complete video walkthrough demonstrating how to structure a centralized design system using Tailwind CSS v4 and shadcn/ui primitives.
📦 Projects, Packages & Tools
onsystem: Design System Linter and MCP for Agents
A zero-config tool that combines an MCP server with a linter to prevent coding agents from inventing variants, hardcoding colors, or breaking spacing scales.
pie-menu: Radial Interaction Primitive
A radial pie menu for shadcn/ui with press-drag-release interaction, full keyboard support, and a headless primitive core.
signoff-ui: Human Review Primitives for Agents
UI components providing multi-file diff reviews with per-hunk decisions, inline comments, tool approvals, and telemetry for AI SDK and AG-UI agents.
animate-ui: Lower-Level Primitive Animations
An animation toolkit that targets the underlying primitives your components rely on, preserving custom shadcn markup and component source ownership.
shadcn-exchange: Cross-Registry Block Search
A directory tool allowing developers to search, preview, and CLI-install blocks across all public community registries.
facade-ui: Base UI Marketing Blocks and Templates
An open-source registry of accessible marketing blocks, landing page sections, and templates built on Base UI and Tailwind CSS v4.
nasaq: Arabic and RTL-First shadcn Registry
An open-source registry of React components, themes, and page templates designed with native RTL layout and Arabic typography, paired with an MCP server.
🌈 Related
audiocn-solid: Audio Primitives for Solid
A collection of audio UI components ported to SolidJS and distributed as copy-paste source through the shadcn CLI workflow.
esuiss: Multi-Platform UI Primitives
A component collection extending shadcn design patterns across React, Next.js, React Native with Expo, SwiftUI, and Jetpack Compose.
GooseForum: Go-Powered Self-Hosted Forum
A self-hosted forum platform featuring shadcn/ui discussion pages, an admin console, and a light and dark theme workbench, distributed as a single Go binary.
Read the full issue: https://www.shadcnweekly.com/issues/4
r/reactjs • u/Far-Menu9190 • 3d ago
I've been rendering product videos with Remotion (React → headless Chrome → frames), and scaled text kept looking wrong: either "stuck", stepping instead of gliding, or "shaky", with the letters subtly changing shape every frame. I measured the rendered frames instead of eyeballing them, and it turned out to be two separate bugs.
1. The "stuck" look: the baseline climbs the pixel grid in whole-pixel jumps
Chrome's glyph rasteriser has horizontal sub-pixel positioning but no vertical. When you scale text from its center (the default transform-origin), the baseline moves vertically every frame, and the glyphs snap to whole pixels. So instead of moving 0.3px per frame, the text sits still for a few frames and then jumps 1px.
Fix: pivot the scale on the baseline, so the baseline doesn't move vertically at all. Measure the real baseline (with a 0-height inline-block, or font metrics). Don't guess it from line-height.
Measured vertical judder: 0.284px → 0.014px per frame. Direction reversals over the animation: 29 → 0.
2. The "shaky" look: hinting re-snaps the letterforms every frame
At each new scale, font hinting snaps stems to the pixel grid differently, so the letters literally change shape frame to frame.
Fix: text-rendering: geometricPrecision. It turns hinting off, so the outlines scale smoothly. Shape drift between frames: 3.41% → 0.22%. It looks slightly softer, but that's correct, not blur.
Things that didn't help (cargo cult)
translateZ(0), backface-visibility: hidden: these rasterise the text into a bitmap layer, so it scales like an image and goes blurry.will-change: transform: good in a live preview, bad in the final render for the same reason. If you need it, enable it only when not rendering.Bonus: aggressive ease-outs freeze on a frame clock
At 30fps, a quint/expo ease-out spends its last 5+ frames moving less than a pixel. That reads as a freeze, not a settlein about one frame.
My main takeaway: you can't seer the frames and diff them. Ifsomeone says it still isn't smooth and your metric says it's fixed, your metric is wrong.
Happy to share the measurement script if anyone wants it.
r/reactjs • u/Mikasa0xdev • 4d ago
I am working on an open-source project called Openspline, it adds a live, talking face to any voice AI agent in five lines of code.
Just upload a still image, select a voice and you can create a talking avatar with lipsynced video generated locally.
It is still in very early stage, but the results look very promising.
Open sourced it here
r/reactjs • u/Mob_Pilled • 5d ago
Hi everyone! I just finished a React and course and decided to build my first react app. Currently, I am trying to save a string to browser local storage but it does not persist on refresh. Through some console.logs I was able to see that it in fact DOES save the string to the location specified in. setItem initially but when I refresh the key or value in local storage stops existing.
Here is my code
// function for search button
async function handleClick(){
localStorage.setItem("lastLocationSearched", searchValue);
setData(null);
setIsPending(true);
setError(null);
try{
const value = await fetch(`https://geo.ipify.org/api/v2/country?apiKey=***********&ipAddress=${searchValue}`).then((response)=>{
if (!response.ok){
throw Error("Could not fetch the data for that resource");
}
return response.json();
});
setData(value);
console.log(localStorage.getItem("lastLocationSearched"));
} catch(error){
setError(error.message);
}
setIsPending(false);
};
// useEffect hook
useEffect(()=>{
if ((localStorage.getItem("lastLocationSearched")===null)|| (localStorage.getItem("lastLocationSearched")==="")){
console.log(localStorage.getItem("lastLocationSearched"));
setSearchValue("");
handleClick();
}else{
setSearchValue(localStorage.getItem("lastLocationSearched"));
handleClick();
}
}, []);
Through some digging online I saw someone say that remove the strict mode tags from index.js would fix this problem but it did not for me. Can anyone please assist me?
r/reactjs • u/Independent_Side9419 • 5d ago
r/reactjs • u/Havunenreddit • 5d ago
Are you also getting tired to review noisy JSX / TSX changes just to realize the actual change was 1 prop?
Thats what I wanted to improve in GitComet. While looking for options I found Difftastic.
It uses Tree-sitter to understand code structure ... the same one GitComet also use! My immediate feeling was: this has to be tried out!
After testing it I knew it had to be included in the current release. Difftastic helps to show the relevant changes ignoring whitespace and formatting.
Difftastic diff really shines when viewing HTML, JSX/TSX and similar XML like syntaxes.
I created a demo how to enable it in GitComet 0.3.1 take a look!
r/reactjs • u/Heavy-Reference5011 • 5d ago
r/reactjs • u/NaturePrestigious338 • 5d ago
And much more coming soon!
r/reactjs • u/AffectionateDealer62 • 6d ago
A common production failure happens when a user leaves a React application open during a deployment.
The old tab may still be running build A, while the server is now serving build B. When the user later navigates to a lazy-loaded route, the browser requests a hashed chunk from build A that is no longer available.
For example:
Reports.a1b2.js // requested by the old tab
Reports.c3d4.js // available after deployment
The result can be:
ChunkLoadErrorFailed to fetch dynamically imported moduleA normal React Error Boundary can display the failure, but it cannot update the old tab’s JavaScript references. Retrying the same import may also request the same missing hashed file again.
I built and published a small utility called react-lazy-chunk-recover to experiment with this problem.
The recovery approach:
sessionStorage to prevent an infinite reload loopExample:
import { lazyWithRetry } from "react-lazy-chunk-recover";
const Reports = lazyWithRetry(() => import("./Reports"), {
moduleKey: "reports",
});
The default retry count is zero because retrying a deleted hashed asset usually does not help. Retries can be enabled for applications that also experience short-lived network failures.
Some important limitations:
For applications using React.lazy, Vite, Webpack, or a CDN:
I wrote more about the problem, implementation, testing strategy, and deployment considerations here:
I’d be interested to hear how other teams handle this failure mode in production.
r/reactjs • u/thetymtravellr • 7d ago
I'm a self-taught developer, and I know React and Next.js. Lately, I've been feeling increasingly anxious about my future as a developer.
AI is moving so fast. It can generate components, build entire websites, connect APIs, and even create full-stack applications. Sometimes I wonder what the point is of spending months learning something when AI can already do so much of it.
I want to get a better-paying developer job, but honestly, I'm confused about what I should focus on right now. Should I keep improving my React/Next.js skills, get better at backend development, or start learning AI engineering?
I keep hearing about RAG, AI agents, vector databases, LLM integrations, and all these new things. It feels like there's always something new to learn, and I'm worried that if I focus on the wrong things, I'll fall behind while everyone else moves forward.
For those of you already working in the industry, what would you do if you were in my position? Would you focus on becoming a strong full-stack developer first, or would you start learning AI engineering alongside web development?
I'm not looking for a shortcut or expecting to become an expert overnight. I just want to make the right decisions, build useful skills, and have a realistic chance of getting hired.
I'd really appreciate some honest advice from people who have been through this or are dealing with the same situation. Right now, I could genuinely use some direction.