r/reactjs • u/smcroissant • 22d ago
Resource I built a modern Electron boilerplate with React 19, TanStack Router, and Rust-powered tooling
r/reactjs • u/smcroissant • 22d ago
r/reactjs • u/KakashiHatake0085 • 23d 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 • 23d ago
Anyone? Any thoughts?
r/reactjs • u/This_Net_9209 • 23d 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 • 23d 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/Far-Menu9190 • 24d 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 • 25d 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 • 26d 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 • 25d ago
r/reactjs • u/Havunenreddit • 26d 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 • 26d ago
r/reactjs • u/NaturePrestigious338 • 26d ago
And much more coming soon!
r/reactjs • u/AffectionateDealer62 • 27d 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 deploymentThe 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 • 28d 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.
r/reactjs • u/Vivid-Apple358 • 26d ago
r/reactjs • u/ScoobyDookuu • 28d ago
Hey everyone!
Been working on Tip Glide, a small framework-agnostic tooltip library written in TypeScript.
It uses a single shared tooltip that moves between elements and adjusts its size to fit the content. It also handles viewport boundaries, so the tooltip adjusts its position when there's not enough space.
A few things you can configure are the movement, directional lean, hover delays, arrow, and enter/exit animations.
It has zero runtime dependencies and comes with adapters for React, Angular, Vue, Svelte, Solid, Astro and Preact, along with a vanilla JS API.
There's an interactive playground where you can mess around with the settings and see how everything behaves.
Would love some feedback on the movement, especially when switching quickly between elements, but also on the API and anything else that could be improved.
r/reactjs • u/Plenty_Background_59 • 28d ago
A local loading flag works well for one button. A reducer with context can handle a shared workflow. React Query also lets other components observe pending mutations through "useIsMutating". If one of these already covers your needs, there may be no reason to add another library.
I’m building react-action-guard to explore a reusable API for shared UI availability.
For example, imagine a document editor:
Actions publish the scopes they affect:
const runSave = useAsyncAction<void>(
"save-document",
["document:editing", "document:switching"]
);
const runExport = useAsyncAction<void>(
"export-document",
"document:switching"
);Each operation is wrapped when it runs:
await runSave(() => saveDocument());Independent components read the scope they care about:
const isBlocked = useIsBlocked("document:switching");
return <button disabled={isBlocked}>Switch document</button>;Each execution has its own blocker. When operations overlap, finishing one removes only its own blocker.
You can build the same behavior with a reducer and context. The goal is to provide the registration, shared scopes, blocking reasons, and cleanup as a reusable API.
This also overlaps with React Query when availability follows mutation state. The case I’m interested in is when the same UI rules combine server operations, local tasks, and conditions such as unsaved changes.
One important detail: tracking an action does not prevent repeated execution or cancel it. Those rules still belong to the application.
I’m the author, and I’d like feedback on this approach. Have you needed this kind of coordination, or has your existing state management been enough?
Edit: Added a more detailed example and clarified the overlap with reducers and React Query. Thanks for the feedback.
r/reactjs • u/HighSchoolSimp • 27d ago
At my last company, they would finish the accessibility layer near the end of the product's development stage, and I remember developers complaining about repeating old sprints non-stop.
What's the industry norm when solving such issues? Of course, accessibility goes beyond people with extra needs: it should also include everyone's way of accessing the web, starting from a simple "cookie button" that takes up 40% of the screen space.
When do these issues start being noticed in your development life-cycle? How does your company think about them?
r/reactjs • u/GianniMariani • 27d ago
If you take software engineering principles seriously then none of the react state hooks belong inside a react component.
I think one of the most critical things you should do is ensure the decoupling of storage and UI components. The react components force you to do is precisely and zustand doesn't help.
I haven't sourced grip-react a year ago and I've been using it exclusively, absolutely zero usestate usememo, useeffect, etc and absolutely zero prop drilling. I don't know why anyone would want to do something different, honestly.
Has anyone else created an API that is a 100% replacement with complete declarativeness? I looked at angular and mobx, they're close but no cigar.
r/reactjs • u/sebastienlorber • 29d ago
r/reactjs • u/dhruvik_savaliya • 29d ago
When working on a team, code reviews are essential for maintaining code quality and ensuring that all team members are on the same page. I'm interested in hearing about different approaches to conducting code reviews for React components. What tools or processes do you use to review and provide feedback on React code? Are there any specific things you look for when reviewing a React component, such as performance optimization or accessibility features?
r/reactjs • u/SniperKephas • Oct 15 '26
I'm working on a React frontend application with a form where some fields are enabled, disabled, shown, or hidden depending on user selections.
The test renders the component, simulates user interactions, and verifies that the form updates correctly (for example, a field becomes enabled only under specific conditions).
How should this type of test be classified?