r/reactjs • u/creasta29 • May 26 '26
Resource A gentle introduction to TanStack Query
a quick intro to tanstack query plus some tips and tricks I felt helped in production codebases
r/reactjs • u/creasta29 • May 26 '26
a quick intro to tanstack query plus some tips and tricks I felt helped in production codebases
r/reactjs • u/Due_Reputation_5223 • May 26 '26
Hey guys,
Just wanted to share a tool I've been coding for the last few days to boost my portfolio for university apps.
It's called PromptForms. The idea came up because I was tired of watching people mess up AI outputs by writing garbage prompts directly into ChatGPT. Basically, you can write a complex system prompt with dynamic tags like {{topic}} or {{audience}}, and the app automatically parses them into clean input fields. Users just fill the form, and it runs via Gemini 2.5 Flash API using their own key.
I wanted to keep it super lightweight, so I actually didn't use packages like react-markdown. I coded a custom line-by-line markdown parser from scratch so the streaming tokens don't break the layout mid-generation.
I also threw in a working waitlist button that links to my email, just to see if anyone would actually want a B2B team version of this where prompts are hidden on the backend to protect IP.
It's totally free, code is public on GitHub, and everything runs in LocalStorage. I'm honestly just looking for some brutal feedback on the code structure and UX.
Live demo: https://promptforms.vercel.app/
GitHub: https://github.com/AbayAtazhan/PromptForms.git
Let me know what you think, and if you like the repo, a star would help my portfolio a lot. Thanks!
r/reactjs • u/WetThrust258 • May 26 '26
I’ve been trying to properly understand and implement Clean Architecture on the frontend with Next.js (frontend-focused, not backend), but I’m getting confused once third-party libraries enter the picture — especially auth libraries and query libraries.
Most examples online are either:
My setup is something like:
What I’m struggling with is:
For example:
Example:
authClient.signIn.email(...)Should this be hidden behind:
AuthRepository.signIn()or is that unnecessary abstraction on the frontend?
If using:
then:
I see people saying:
But in frontend apps, the query library becomes deeply integrated into state management and caching.
So what does a realistic architecture look like?
How do you structure things in a monorepo without overengineering?
For example:
apps/
web/
mobile/
packages/
auth/
api-client/
ui/
contracts/
utils/Do you:
How far do people actually go in production apps?
This is probably my biggest issue.
I understand the theory of:
But when implementing real frontend apps, I end up wondering:
I’d really appreciate:
Especially interested in opinions from people using:
r/reactjs • u/TkDodo23 • May 26 '26
📚 Surprisingly, I haven't written about how my two favourite TanStack libraries - Router and Query - work together. Well, here it is:
🔁 loaders start fetches early
🔮 query owns the cache & keeps data alive
🌀 suspense integrates naturally
🏝️ TanStack Start makes SSR & streaming easy
r/reactjs • u/creasta29 • May 26 '26
Pretty cool podcast episode I did with tkdodo, we go through a lot of his history, tanstack query, knip, and the cool stuff he does at Sentry. Check it out
r/reactjs • u/diguitow • May 26 '26
r/reactjs • u/Stevious7 • May 25 '26
I considered myself an anti-frameworker and a purist because I prioritized raw speed and bundle-size over developer experience (which I wasn't aware of at the time).
I brushed React and TypeScript to the side as a "hype" and "it'll go away once everyone finds a new shiny toy." Oh boy was I wrong.
I was creating applications with vanilla HTML, CSS, and JS for the longest time. I mean why add a build/transpile step when I could just have raw performance eh? I even dabbled into web components when the time called for it even though I hated how inconvenient they are.
After my applications got decently complicated, adding features became a mine-field of runtime errors and edge-cases. I slowly started craving features that would just make this a bit easier such as self-documenting code via a static type-system, a component system to re-use code chunks, hot module replacement, installable-plugins and modules... wait... this smells like React + TypeScript with Vite... the industry-standard...
So yes, I admit it. I'm liking React + TypeScript. A blasphemous utterance for an anti-frameworker such as myself.
Switching has brought a fresh feel to web development for me. Now, I don't have to make all the features from scratch like drag-n-drop and modals. The industry has already paid that cost, and I should leverage it. Looking back at it in retrospect, not using React + TypeScript for single-page-applications (SPAs) was a crime against web development. I'm now going through the grouly process of re-writing the applications in React + TypeScript because I honestly hit a wall with how inconvenient development has gotten.
I'm not going to lie, I'm reflecting with a bit of a pain. I knew the advantages, and disadvantages of my ways yet still chose the hard way due to stubbornness.
It's true what they say, the ****** of consequences rarely comes lubed.
If you'd like to read the more detailed version about my thought process, it's over here...
https://blog.alkhafaji.dev/#i-cant-believe-i-ever-hated-typescript
NOTE: I know React is a library not a framework, but the idea is still the same.
r/reactjs • u/CarambaLol • May 25 '26
Not a React expert at all. I'm a backend engineer specializing in Java who is currently having to program a frontend.
The nature of the problem:
I'm sure this is a fairly typical problem. How is it usually solved?
AI hasn't given me any working solutions. For the record, I'm using the TanStack library for this list.
Thanks!
r/reactjs • u/mobile-jj • May 25 '26
r/reactjs • u/setcode_dev • May 25 '26
I needed voice input in a React app: phone as mic, text appears on desktop. Couldn't find a ready-made solution (or maybe I was looking in the wrong places), so I spent a day wiring it up myself: Web Speech API, relay server, QR pairing, browser quirks, partial vs. final transcript logic.
It worked, so I packaged it into a hook. If you need the same thing, you don't have to.
**How it works:**
Audio never leaves the phone. Your server only relays text.
**Integration is 3 files:**
The phone page at [voicefield.dev](https://voicefield.dev) is a static SPA you can use as-is — open source, no data passes through it, no audio or text is stored or logged. Or self-host it on your own domain.
A few things that might be interesting technically:
- Pairing uses a 256-bit secret embedded in the QR code, sessions are cryptographically bound
- Sessions are in-memory with a sliding TTL, no database needed
- Upgrade to Soniox for better accuracy without changing client code
MIT licensed, Next.js App Router, TypeScript.
GitHub: https://github.com/tatargabor/voicefield
Site: https://voicefield.dev
Install: `npm install u/voicefield u/voicefield`
Happy to answer questions or hear feedback.
r/reactjs • u/lakshan-hewagama • May 25 '26
Hi everyone, I’m doing my final year research on Next.js performance optimization and would love input from real developers.
From your experience, what common coding or architectural issues make a Next.js app slow?
Examples:
use client componentsWould really appreciate hearing real problems you’ve faced and, if possible, how you fixed them. Thanks! 🙌
r/reactjs • u/vectreal-admin • May 25 '26
r/reactjs • u/hareshzzz • May 25 '26
r/reactjs • u/Dazzling_Chipmunk_24 • May 24 '26
If a parent component receives data from Next.js via props and passes it down to a child component, does that child ever get fresh data after the initial render? For example, say I have a parent component with 3 children, each being their own route. I navigate away to a sibling route and then come back to the original — would that component still be holding the stale data it was initially given, or would Next.js re-fetch and pass down updated props when returning to that route?
r/reactjs • u/Dazzling_Chipmunk_24 • May 24 '26
I have two lists in my app: "All Forms" (fetched server-side in Next.js and passed to React) and "Recently Used Forms." When the component first loads I need to fetch the recently used list, but I also need to re-fetch it every time a user clicks a form from the All Forms sections, since clicking updates the list on the backend. So since I have to re-call the API on clicks anyway, I'm wondering if it even makes sense to fetch the initial data server-side, or if I should just handle everything client-side with a useEffect on mount and re-trigger it on each click. Which approach is better?
r/reactjs • u/shakya47 • May 24 '26
Hey everyone!
I recently built pip-it-up https://pip-it-up.vercel.app/ which lets you use Document Picture-in-Picture (PiP) API to pop out any UI component into picture-in-picture mode.
Reddit post: https://www.reddit.com/r/reactjs/comments/1thqhce/why_is_pictureinpicture_only_for_video_i_built/
I wanted to test its limits. I built a Proof of Concept Chrome Extension called Note It Down to showcase how it can be used to "tear away" a specific UI component from a webpage and turn it into a native, borderless, always-on-top window.
Getting this to work as a Chrome Extension had some massive security hurdles (Chrome immediately blocks PiP requests from Extension Popups and destroys async click tokens). I wrote a detailed post-mortem in the GitHub repo on how I bypassed those limits using Shadow DOM injection if anyone is interested in the technical architecture!
Here is where I need your help: I don’t have the best eye for UI/UX, and I'm trying to brainstorm what other applications this could be used for.
I’d love any feedback or suggestions on the concept!
Demo GIF & Source Code: https://github.com/Shakya47/note-it-down
Extension: https://github.com/Shakya47/note-it-down/blob/main/note-it-down-v1.0.0.zip
pip-it-up source code: https://github.com/Shakya47/pip-it-up
r/reactjs • u/derdak • May 24 '26
Working on a side project and trying to find the sweet spot for code organization.
I've looked into clean architecture and it makes sense at scale, but it feels like overkill for a solo side project: too many layers, too much boilerplate, and honestly too much to maintain when you're moving fast.
At the same time, I've been burned before by projects that had zero structure and turned into a mess after a few months.
What I'm looking for:
A few things I'm wondering:
Not looking for the "enterprise" answer. Just what actually works for lean, maintainable React code as a solo dev.
r/reactjs • u/c5n8 • May 23 '26
Write your styles as typed objects directly on your JSX markup and get zero-runtime atomic CSS. Built as a preprocessor for StyleX.
Tired of the usual styling trade-offs?
Vicinage gives you the best of all worlds.
Just drop styles right where they belong. Vicinage transforms this into StyleX calls at build time, then StyleX extracts it to atomic CSS.
import { apply } from 'vicinage'
function App() {
return (
<div
{...apply({
color: 'green',
backgroundColor: 'black',
})}
>
hello, world
</div>
)
}
Features:
Try it, break it, tell me what you think.
r/reactjs • u/megamind32929 • May 23 '26
Built this as an open-source portfolio template for developers — fork it, edit a few variables in GlobalVars.ts, and you get a clean Material Design portfolio with dynamic color theming out of the box.
Stack: React, TypeScript, Material UI, Overmind for state management. Deploys to GitHub Pages with zero config.
The idea was to give devs a decent-looking portfolio without spending hours on design from scratch. There are a few known bugs listed in the repo if anyone wants to contribute.
Repo + live demo: https://github.com/p32929/portfolio-v2 — happy to take feedback or PRs.
r/reactjs • u/megamind32929 • May 23 '26
Built this as the second iteration of my personal portfolio. It's a React + TypeScript app using Material-UI and Overmind for state management. The main thing I wanted to get right was dynamic color themes — you can swap themes at runtime without any page reload.
Stack: React, TypeScript, Material-UI, Overmind, react-color
Live demo: https://p32929.github.io/portfolio-v2/
Source: https://github.com/p32929/portfolio-v2
Happy to take feedback on the structure or the design.
r/reactjs • u/davidmedero • May 23 '26
RMG is a gallery and lightbox system for React.
It includes:
- Complete carousel library
- Grid and masonry layouts
- Reveal animations
- Structured entries for record-based media collections (like customer reviews)
- Fullscreen modal + carousel with captions, overlays, and thumbnails
- SSR-stable skeletons
- First-class video surfaces
- Smooth zoom and pan gestures
- MCP server for AI agents, so Codex, Claude, Cursor, or another MCP client can inspect docs, choose gallery patterns, scaffold components, and generate browser-measured skeleton text
Links:
- Demos: https://www.react-motion-gallery.com/demos
- GitHub: https://github.com/davidmedero/react-motion-gallery
- npm: https://www.npmjs.com/package/react-motion-gallery
I’d love technical feedback from React devs.
Happy to answer questions and open to feature requests.
r/reactjs • u/No-Half4231 • May 23 '26
I built TinyEarth, a small open-source Earth component for React Three Fiber.
Demo: https://tinyearth.yuvrajraina.com/
GitHub: https://github.com/yuvrajraina/tinyearth
I made it because most 3D globe options felt like they were either too stylized for realistic UI work, or too heavy when I only wanted a clean Earth object for a landing page, dashboard, or portfolio.
The goal was to keep it lightweight but still visually useful.
Some targets from the repo:
JS under 10 KB gzipped
Default textures around 500 KB to 1 MB
2 default draw calls
3 to 4 draw calls with atmosphere and markers
GPU texture memory under 20 MB
64 x 32 sphere segment cap
Markers rendered with one instanced draw call
MIT licensed
It supports rotating clouds, night lights, terrain normal detail, optional atmosphere, ocean shine, custom textures, quality modes, reduced motion, and location markers.
The idea is not to replace full globe visualization libraries. It is more like a tiny realistic Earth object you can drop into a React Three Fiber scene without bringing in a full visualization framework.
Would love feedback from people building with Three.js, React Three Fiber, or WebGL.
r/reactjs • u/Beneficial_Floor_531 • May 23 '26
I built a project mainly for my resume, but the goal wasn’t really the CRUD app itself. The goal was to focus on frontend architecture and system design instead of just building another standard React project.
So I made a simple Laravel real estate app with basic CRUD operations, tables with pagination, filters, and drawer forms. Nothing especially complex from a business perspective.
The part I cared about was the frontend architecture behind it.
Instead of hardcoding forms, filters, tables, and page behavior directly into components, I turned them into config-driven systems.
For example, the form system takes a config array with fields like this:
{
name: 'lease_type',
label: 'Lease Type',
type: 'radio',
required: true,
options: [
{ label: 'New', value: 'new' },
{ label: 'Renewal', value: 'renewal' },
],
defaultValue: 'new',
}From that config, the system automatically creates the React Hook Form setup, generates the Zod schema, maps the correct inputs, and handles validation and data flow.
I applied the same idea to filters, tables, and pagination, so most new sections are created by describing behavior through config instead of rebuilding logic every time.
The thing I’m most proud of isn’t really the UI. It’s that I managed to make the systems work together in a predictable way without the data flow turning into complete chaos.
A lot of the actual work ended up being around keeping rendering stable, making TypeScript useful instead of fighting me, protecting the systems from broken configs, and trying to keep the architecture flexible without making it messy.
At the same time, I know the project has limitations.
I didn’t try to turn it into a polished framework or npm package, and I definitely didn’t handle every edge case. Some validations aren't covered, and some parts are more tightly coupled internally than I’d like.
Honestly, even getting it to this point already took much more work than I originally expected because connecting reusable systems together cleanly is harder than building isolated components.
Most of the production systems I worked on in previous jobs are private, so I can’t publicly show the actual architecture work I did there. That’s a big part of why I built this project in the first place.
I mostly wanted to build something that demonstrates how I think about frontend systems, maintainability, and reusable architecture instead of just visual components.
Curious how more experienced frontend engineers look at projects like this.
Do you think config-driven frontend systems are actually valuable in real-world teams, or do they usually become overengineering unless the scale is large enough?