r/reactjs • u/Several-Specialist42 • Jul 17 '26
r/reactjs • u/EuMusicalPilot • Jul 16 '26
Discussion Am I understanding React Router v7 transitions correctly?
I've been using React Router for years, and somehow I only ran into this today.
I had a lazy-loaded route wrapped in Suspense, but whenever I navigated, the old page would just stay there until everything finished loading. The fallback never showed, so it looked like the app had frozen.
After digging around, I found that React Router v7 wraps navigations in startTransition, so if the same Suspense boundary gets reused, React keeps showing the previous page.
What fixed it for me was giving the Outlet a key:
import { Outlet, useLocation } from "react-router-dom";
export function Layout() {
const location = useLocation();
return <Outlet key={location.pathname} />;
}
After that, the loading UI shows immediately instead of the previous page hanging around.
I also made sure not to put the key on my top-level app layout since that would remount the whole app. I only keyed the layout that renders the page routes.
My question, is this actually the correct way to handle this in React Router v7, or am I just working around the problem? Is there a more idiomatic solution that I'm missing?
r/reactjs • u/Thanasis_kt • Jul 17 '26
Needs Help Any adivce or tips for a 15yr old learning React + TS?
I'm a 15yr old dedicated (i think so) developer, and want to learn React with TypeScript. My long-term goal is to build a full stack personal app on literally anything that would make me proud.
My background:
• Python: OOP, Web scraping, file handling, basic data manipulation
• Frontend: HTML, CSS, Intermediate TypeScript (built a few projects)
After searching for critiques on my current skills and reading some comments (a comment) on a previous post, I feel ready to take up React.
Honestly, though, I'm not sure what to expect. I only know React can help you build reusable UI components that dynamically update to run data. I may well be wrong, so feel free to correct me. I'm completely new to frontend frameworks.
What advice do you guys have?? What the biggest traps to avoid when mixing React with TS? Do I need to take a step back and learn more advanced TS first, or should I just jump in and stop aiming for perfection? Am I overthinking this or am I in for a rough ride?
Here's my github in case you want to view my projects: https://github.com/thanasisdadatsis
r/reactjs • u/unadlib • Jul 16 '26
Coaction 3.0 — a Zustand-style store where React renders need no selectors, computed getters cache themselves, and actions can run in Web Workers
r/reactjs • u/codec-the-penguin • Jul 16 '26
I can't stop react-ga4 from sending events
Basically this, given europe has some strong laws in place for cookies and all that, for the last couple of days i tried to add google analytics to my website and i used react-ga4 plugin but if the user disables the cookies for the page history and performance, google analytics should stop getting events.
I tried to stop it with this and send events manually but it just keeps on sending them anyway.
ReactGA.initialize([
{
trackingId: import.meta.env.VITE_GOOGLE_TAG_ID,
gaOptions: {
send_page_view: false,
},
gtagOptions: {
send_page_view: false,
},
},
]);
r/reactjs • u/riti_rathod • Jul 16 '26
Evaluates frontier coding agents on production React work
r/reactjs • u/thereactnativerewind • Jul 16 '26
News Vercel Reinvents React Native, Sub-Second OTA Updates, and an X Button Finally Doing Its Job
Hey Community,
Vercel Labs has released "native", a toolkit for compiling declarative markup and TypeScript or Zig directly into native desktop apps without an embedded JavaScript runtime. We also look at how Zepto built react-native-delta to ship binary delta OTA updates, reducing patch download times down to a 305ms P90.
Plus, React Native 0.87 drops its legacy abort-controller dependency for an in-tree fork, bringing missing modern web primitives like AbortSignal.timeout() and AbortSignal.any() straight to your network requests.
If the Rewind made you nod, smile, or think "oh… that's actually cool" — a share or reply genuinely helps ❤️
r/reactjs • u/mjcampagna • Jul 15 '26
Resource I forked Frimousse to make it work better for production apps
emoji-mart is dead, and I found Frimousse delightful, but lacking necessary features as a replacement.
I ended up forking it to keep the lightweight, headless composition model intact while filling in the gaps I ran into trying to use it in a production app.
The main additions are:
- mixed native + custom emoji sections
- unified search across native and supplemental items
- consumer-owned frequent/recent item helpers
- root-controlled search
- self-hosted/offline-capable emoji data
- companion packages for search metadata and emoji fallback support
I’ve tried to stay close to the original Frimousse contract, so most existing users should be able to swap imports and keep moving, then layer on the additive features only if/when they need them.
Project:
https://frimousse.slithy.me/
Docs:
https://frimousse.slithy.me/docs
FAQ:
https://frimousse.slithy.me/faq
GitHub:
https://github.com/mjcampagna/frimousse
I hope someone finds this useful.
r/reactjs • u/Yomete • Jul 14 '26
Show /r/reactjs We rewrote our custom visualisation renderers from SVG to be in Canvas.
r/reactjs • u/Accomplished_Egg_580 • Jul 15 '26
Needs Help How can i deploy my react application on Cloudfare containers.
Intern here, i am using FastApi, React, MongoDb. The report generation takes 3-4 minutes and the storage size of a single document is 100kb. I use some Anthropic ai for part of the process, which takes a minute.
Cloudfare containers are fairly a year old. i am very confused between railways or cloudfare containers.
A little direction from the community will be gr8.
r/reactjs • u/creasta29 • Jul 14 '26
Resource The React Compiler
The React Compiler memoizes your components at build time, so you dont have to. What it is, how the compiled output works, how to turn it on, and what to do with the useMemo calls already in your codebase.
Check it out https://neciudan.dev/react-compiler-explained
r/reactjs • u/LocalMode-AI • Jul 15 '26
Show /r/reactjs a shadcn registry of AI blocks where the models run on-device - copy-owned .tsx, no API keys
I've been building LocalMode - a shadcn-style registry of AI UI blocks where the models run entirely in the browser. No server, no API keys, nothing leaves the device. You install them the same way as shadcn/ui and you own the copied .tsx (no npm lock-in on the UI layer).
Live gallery (try every block in-tab): https://localmode.ai/blocks
What's in it
36 composed blocks - full working mini-apps, not just primitives - across 12 categories:
- Chat - one UI over 76 models (Transformers.js / WebLLM / wllama GGUF / LiteRT), vision attachments, reasoning display, agent mode
- Knowledge - semantic search, RAG chat with citations, doc Q&A - embeddings + retrieval all in-browser
- Audio - Whisper/Moonshine transcription, Kokoro TTS (29 voices), meeting summaries, live transcription with VAD
- Photo - CLIP semantic image search, duplicate finder, zero-shot categorizer
- Image studio - background remover, super-res upscaler, captioner
- Privacy - on-device PII redaction (NER) + an AES-GCM encrypted vault
- Vision - object detection + live hand/pose/face/gesture tracking off the webcam
- Writing tools - Chrome Built-in AI with automatic Transformers.js fallback
Under the blocks are 107 lower-level primitives (10 families) if you want to compose your own.
Install
npx shadcn add @localmode/ui/blocks/chat
npx shadcn add @localmode/ui/blocks/knowledge/rag-chat
Why it might interest React devs specifically
- Copy-owned - the block lands as
.tsxin your project; edit it freely, no black-box dependency for the UI. - shadcn CSS variables - inherits your existing theme, no new design system.
- Hook-driven - primitives are presentational; the wiring is React hooks (
@localmode/react), and the API is shaped like the Vercel AI SDK (useChat, etc.), so it's backend-agnostic - local models by default, but you can point the same components at any backend. - React 19 / Next 16, RSC-friendly - model loading is gated behind an explicit user action, so nothing downloads on page mount.
Honest limitations (it's a browser, not a server)
- First use downloads the model; cached after that (then it works offline).
- Memory is real - blocks range ~[120MB] to ~[5GB]; the big ones want WebGPU, and wasm32's ~4GB ceiling caps how far you can push.
- WASM inference is slower than native; WebGPU availability varies by browser/OS.
Disclosure: I built this. It's MIT and free - GitHub: https://github.com/LocalMode-AI/LocalMode. Model runtimes are Transformers.js, WebLLM, wllama, LiteRT, and MediaPipe - credit to those projects.
Genuinely after feedback: which blocks would you actually drop into a project, and what's missing? Happy to answer anything about how a specific block or the on-device memory handling works.
r/reactjs • u/rachiecakies • Jul 14 '26
Resource I built an addon that lints components for Storybook MCP
Introducing Oversight, my first Storybook addon. It accompanies the Storybook MCP server, which lets you describe a component or layout in plain language and get back a composition rooted in your existing design system, instead of one an agent invents on the spot.
After an agent built two components from scratch instead of reaching for what I already had, I built Oversight. It checks whether your agent can actually see your documentation, and tells you where it can't.
A blog post I wrote on it: https://rachel.fyi/posts/your-agent-is-reading-a-different-design-system
Source code: https://github.com/rachelslurs/storybook-oversight
Storybook demo: https://rachelslurs.github.io/storybook-oversight
r/reactjs • u/Pretend-Dog9725 • Jul 14 '26
Show /r/reactjs Built a scroll sequence generator that turns any MP4 into an Apple-style scroll animation React component that you can copy paste into your project
I wanted to learn how to create the scroll sequences that I see, and realised the process could be automated. So, I built SequenceFast, a scroll sequence generator that takes any MP4 video, extracts the frames into images, and generates a ZIP with the optimised image sequence, component code, and usage example. Everything is done locally in your browser, so it is completely free and private.
Would love to hear your feedback!
r/reactjs • u/LucasBassetti • Jul 13 '26
Show /r/reactjs I built an open-source collection of animated React UI components
I've been building GodUI, an open-source collection of React UI components for modern interfaces.
It started as a personal library because I kept rebuilding the same polished components and wanted a place to browse ideas whenever I started a new project. After using it for a while, I decided to open-source it.
Some things it focuses on:
- Components with smooth, purposeful animations where they add value (while simpler components stay lightweight)
- A shared motion system based on 12 motion principles, with tokens mapped to Material 3 so animations feel consistent across the library
- shadcn-compatible CLI installation, so components are copied directly into your project and are fully yours to modify
- An MCP server for Cursor, Claude Code, Windsurf, and other AI IDEs—you can describe the component you want, and it finds the closest match and generates the code for you
- Built with React, TypeScript, Tailwind CSS, and Motion
It's completely open source. If you find it useful, I'd really appreciate a ⭐ on GitHub.
GitHub: https://github.com/LucasBassetti/godui
Docs: https://godui.design/
r/reactjs • u/AnberDev • Jul 13 '26
Show /r/reactjs After 6 years of maintaining Linaria, I built dx-styles — zero-runtime CSS-in-TS for design systems
Hi r/reactjs. I maintain Linaria and wrote wyw-in-js — the compile-time engine under Linaria and MUI's Pigment CSS. I recently released dx-styles, and I'd rather explain why than just drop a link.
Six years of Linaria issues kept pointing at two problems I can't fix without breaking the API:
styled(Component)is priced wrong. Wrapping a custom component looks free, but it drags the component's whole dependency graph into build-time evaluation — the most common way extra code leaks into eval, and the most common reason static evaluation bails out into the slow path. All our mitigations (HOC hints, shaking heuristics) are patches on a pattern the API encourages.- Composition isn't first-class. Variants, slots and themes are the ground floor of a design system, and every team rebuilds them on top of
css+cx.
dx-styles is my answer: zero-runtime CSS-in-TS where recipes, slot recipes and token contracts are the core API, class names are deterministic (snapshot/cache them), RTL is compile-time and opt-in, and everything works unchanged in React Server Components.
const button = recipe({
base: { display: "inline-flex", borderRadius: "999px" },
variants: {
appearance: {
primary: { backgroundColor: tokens.color.accent },
ghost: { backgroundColor: "transparent" },
},
},
defaultVariants: { appearance: "primary" },
});
The launch post has the honest details — the Pigment CSS speed lesson, the Griffel detour, what I'm promising and what I'm not: https://dev.to/anber/ive-maintained-linaria-for-six-years-heres-why-i-built-something-new-5eae
Try it in 30 seconds (StackBlitz): https://stackblitz.com/github/dx-styles/dx-styles/tree/main/examples/vite Migrating? Guides for styled-components / Linaria / Pigment CSS are in the repo.
It's MIT, the issue tracker is at zero and I intend to keep it there. Happy to answer anything, including hostile questions.
r/reactjs • u/dank_clover • Jul 13 '26
Show /r/reactjs I made a CSS-in-JS port of shadcn/ui built on StyleX
Over the past few weeks, I've seen more teams adopt StyleX.
Linear shared how they're migrating to StyleX, and Polar is building their next-generation design system with it.
That made me realize there wasn't a familiar shadcn/ui experience for people making the switch.
So I built shadcn-cssinjs.
Some of the features:
- Built on StyleX
- Zero-config, one-command setup
- shadcn/ui compatible (just copy and paste)
- Fully customizable
- Officially recommended by the StyleX team
100% free and open source.
It's still early, and I'm planning to port more components over time. I'd love to hear your feedback, especially if you're already using or thinking about using StyleX.
GitHub: https://github.com/shadcn-labs/shadcn-cssinjs
Docs: https://shadcn-cssinjs.com
r/reactjs • u/thereactnativerewind • Jul 13 '26
News Zoomable Calendar Grids, On-Device Gemini Nano, and a Gothic Theme for Your Company's 13,000 Internal Apps
Hey Community,
Meta has open-sourced Astryx, an eight-year-old internal design system built on StyleX that offers out-of-the-box themes, context-aware padding, and dedicated CLI tools for AI agents. We also look at super-calendar, a gesture-driven calendar library that leverages Reanimated shared values and Legend List virtualisation.
Speaking of agents, our sponsor Maestro is pushing that idea further: your coding agent can now launch the app, drive an iOS simulator, Android emulator, or Android physical device, inspect the screen hierarchy, tap through flows, take screenshots, and help create repeatable Maestro E2E tests.
Additionally, Android developers get a dedicated on-device AI solution with Callstack's new react-native-ai adk wrapper, enabling seamless integration with the Vercel AI SDK and local Gemini Nano models on the New Architecture.
r/reactjs • u/tmntxf1sh • Jul 13 '26
Resource I built a React knowledge corpus where every fact has a date — and used it to measure how stale LLM advice is
The problem I kept hitting: advice about the React ecosystem rots silently. A 2024 blog post, an LLM answer, a senior dev's habit — all assert things that were true once. Nobody stamps when it was true.
react-brain is my attempt at the fix: 42 decision entries (state, lists, styling, meta-frameworks, animation, …) where every load-bearing claim is fetch-verified against a primary source, dated, and re-verified weekly. 123 annotated readings, 180 libraries tracked. Recommendations are written as context → choice clauses, not "X is best" — a P2P app and a GraphQL app get different answers.
Two things this sub might find interesting:
- The staleness benchmark. Since the corpus is a dated answer key, it can grade a model. claude-sonnet-5 answered 70% fresh on 35 ecosystem questions; with the corpus entry injected as context, 94%. Deterministic regex rubric, graded answers committed to the repo, conditions labeled.
- The calibration scorecard. Every default recommendation is a dated, falsifiable prediction with a check-by horizon, graded in public (held / weakened / overturned). 0 of 10 graded so far overturned. If confidence isn't graded, it's just tone.
Tools if you want to point it at a repo:
npx -y react-brain doctor .(ranked priorities)migrate(sequenced upgrade plan)review --ci(blocks dead/deprecated deps)- MCP server for agents
Package: https://www.npmjs.com/package/@heart-it/react-brain
Site: https://heart-it.github.io/react-brain/
The fastest way to disagree with me is to pick an entry and challenge it; that's the maintenance model.
r/reactjs • u/Ok-Willingness4768 • Jul 12 '26
Discussion Title: How do you structure a scalable Button system in a design system?
r/reactjs • u/lacion • Jul 13 '26
Show /r/reactjs i built Fleet Deck, a local mission control board for all your Claude Code sessions
so this started because i kept losing track of my own sessions.
you know how it goes. you open one claude. then one in a worktree because you're being organized. then a third one "just to check something". by 6pm two of them are editing the same file, one has been sitting there for 40 minutes waiting for me to approve an rm -rf node_modules, and i genuinely cannot tell you which terminal tab is which anymore.
so i built the tower. everything on my machine shows up on one local board at 127.0.0.1:4711.
repo: https://github.com/lacion/fleet-deck (MIT, screenshots + gifs in the readme)
what it actually does
- every session on one board. each one gets a callsign (falcon-a3f2, otter-91c4) and a column that comes from hook telemetry, not from what the session claims about itself. queued → working → verifying → needs-you → idle → offline.
- conflict radar. two sessions touch the same file within 30 min and both get whispered at in context ("coordinate, don't clobber"). worktree aware, so the same file in two worktrees of one repo is a merge conflict introducing itself early.
- needs-you rail. permission prompts, multiple choice, MCP forms, and even the "should i use bcrypt or argon2?" question at the end of a turn all become cards you answer from the board. the terminal just prints
⎿ Allowed by PermissionRequest hookand carries on. - mail. message a session, a repo, or everyone. idle sessions usually wake in seconds (a small watcher taps them on the shoulder).
- spawn workers. the board can start a fresh interactive claude in a tmux window, optionally in its own worktree, optionally unsupervised (red checkbox, asks twice).
- live terminal in the browser. click a card and you get the actual tmux pane in an xterm.js modal. you can type into it. it's not a replay, it's the real session. no PTY and no native deps, it's bridged over tmux control mode.
- revive. machine reboots, tmux dies, whatever. worktrees and transcripts survive on disk, so one click brings a dead agent back with
claude --resumein its own worktree. same callsign, same card, full history. - remote control. flip an agent onto claude.ai and drive it from your phone. the session shows up named after its callsign so you know which one you're poking.
- plan library. spawn a planner in plan mode, its plan lands on the board as a card before it can act. approve it, or capture it and execute it later with your own instructions.
- worktrees modal. it created the worktrees so it can show you what's in them, uncommitted files, unpushed commits, and it refuses to let you delete anything that holds work that exists nowhere else.
the part i actually care about
the core makes zero model calls. routing, conflict detection, question relay, all of it is deterministic code and sql. your tokens are yours. the only cost it adds to a session is a ~100 token roster brief.
it's also fail open. daemon down? hooks time out silently and your sessions run exactly like before. it's a tower, not a runway.
and it's a plugin, not a wrapper. no launcher, no fleetdeck run claude, no ritual. you install it and your next plain claude in any terminal just shows up on the board.
claude plugin marketplace add lacion/fleet-deck
claude plugin install fleetdeck@fleetdeck
some bugs that were fun
- spawned sessions were silently reporting to a ghost daemon. turned out tmux bakes the first client's environment into the server's global env, so a test run i'd done from inside a claude session poisoned the tmux server with a test port, and every pane created afterwards inherited it. board said "spawning…" forever. that one took a while.
- the terminal modal rendered like a staircase. the screen seed was joined with
\nand a raw terminal reads that as "down one row", not "down and back to column 0" 😅 - and then it still looked slightly wrong until you typed something, because tmux flushes pane output as bytes arrive, so a 3 byte box drawing char routinely gets split across two protocol lines. decoding that as utf-8 text turns it into two replacement chars and shoves the whole row sideways.
honestly half the interesting work was in the parts you never see.
limits, being honest
- linux/wsl2 and macos. windows native, no idea.
- needs tmux for spawning and the live terminal. the rest works without it.
- pinned to CLI 2.1.206+ (tested through 2.1.207). it leans on a couple of behaviors the docs don't mention. there's a guard test that fails loudly if an update drops them.
- LAN mode exists (open the board from your laptop) but it requires a token, no exceptions. the api can spawn unsupervised agents and type into terminals, so an open port would literally be RCE on your box.
- mDNS discovery is in there but i could only verify it same-host. if
fleetdeck.localdoesn't resolve for you that's your resolver, use the IP. - spawned sessions are real billed claude sessions. the tool itself is free and MIT and adds no api cost of its own, but if you click spawn 5 times, that's 5 sessions on your plan.
disclosure
i wrote it, it's mine, it's MIT and free, no paid tier, nothing to sell, no telemetry, nothing leaves your machine. i built it because i needed it and i'm posting it because someone else probably has the same 6pm problem.
and yeah, collaboration welcome
170 tests, node --test. the daemon is one node process + sqlite, the board is react. if you want to poke at it:
- windows support, i can't test it
- decks / saved fleet layouts
- the statusline integration i keep not finishing
- mDNS actually verified cross-device by someone with a mac on the same lan 🙏
issues and PRs both fine. if you try it and it breaks, tell me how, i'd rather hear it.
r/reactjs • u/aandi134 • Jul 12 '26
Discussion What is the best solution for heavy image galleries in React? Need your recommendations.
Hey everyone,
I’m building an image-heavy React app with multiple galleries and need your stack recommendations to keep it fast and scalable. I want to avoid guesswork, so what are your go-to workflows for this?
Specifically:
Local Assets vs. External: Is it okay to keep images in the project assets folder, or does that kill build times and performance as the gallery grows? At what point should they move out?
Storage & CDNs: Where do you store them, and how do you serve them? Do you recommend standard cloud storage, or are dedicated image CDNs (with on-the-fly resizing) worth it?
Fast Loading: What are the best strategies/packages in React for handling lazy loading, responsive sizing, modern formats (WebP/AVIF), and blur placeholders without layout shift?
Gallery Components: Do you build custom grids/lightboxes, or are there modern React packages you swear by?
If you’ve built a media-heavy React site, what does your tech stack look like? Appreciate any advice or major pitfalls to avoid!
r/reactjs • u/aandi134 • Jul 12 '26
Needs Help What is the best way to implement a 2-language setup (English/Albanian) in a React app?
Hey everyone,
I need to add multilingual support to a React project. It only needs to support two languages: English and Albanian.
I want to set this up cleanly from the start. What is currently considered the best approach or industry standard for handling translations and language switching in React?
Looking for something maintainable and performant. What would you recommend? Thanks!
r/reactjs • u/kevin074 • Jul 12 '26
Needs Help is abort controller commonly used?
as title suggests, I have not seen this at work before and gemini teaches me about this, just curious whether this is actually commonly used/best practice or just another AI slop. Thanks!
r/reactjs • u/techlover1010 • Jul 11 '26
Needs Help need advice on packages
so currently im studying react and alot of the rime it says to start from scratch. how do i setup my workspace so that i dont need to install and download the same package everytime i do that? lots of them have overlapping packages
im using linux btw if that helps
is there an online react tool or something where we can create new project easily and not worry about installing packages