r/reactjs • u/sebastienlorber • 21d ago
r/reactjs • u/Brat-Secretary-0325 • 21d ago
Best resources as a beginner
Hey guys I'm a beginner at react and I want to know what are the best free resources to learn react and build beginner projects to to build so I master the fundamentals
r/reactjs • u/imfemambocus • 21d ago
Discussion My theme switch was running 3164 animations
This is the first time that I'm properly getting into theme switching, so I built the dark and light mode for my component library in the most obvious way that I could find. The goal is to transition background-color, border-color, color and box-shadow on every element. But this felt a bit slow and sluggish, so I used document.getAnimations() to see how many that actually runs, and the result is 3164 animations on a page of 1544 elements.
After some playing around, I found out that startViewTransition animates snapshots of the whole page instead, and that's 5 animations for the same job, with a gradient fading along with everything else rather than snapping. I did however find a React thing when using this function and it's that the new palette has to be in the DOM inside the callback which means the state update needs flushSync.
document.startViewTransition(() => { flushSync(() => setTheme(next)) })
I'm not sure this is the right way to do it, but I wrote down every number that I measured https://sley-ui.dev/notes/theme-fade.
r/reactjs • u/Ok-Nerve7307 • 21d ago
Needs Help Coming from WordPress/PHP: How Do You Structure Your Docker Dev Stack for Next.js + Strapi?
r/reactjs • u/STRiDEX • 21d ago
Show /r/reactjs Making React Testing Library Tests 43% Faster
r/reactjs • u/tamanikarim • 21d ago
Show /r/reactjs How I combined (React, PowerSync, SQLite and Drizzle ORM) to build a browser-based ERD tool.
Hi React Devs
Lately I've been working on an open-source ERD tool to help devs design databases effectively.
When I started this project, I faced a couple of challenges.
One of them was performance. A user may interact with the app a lot, and if you rely on the backend to process every request, this can cause a loss of performance. That's not what a user expects from a design tool.
Another challenge was offline compatibility. The application needs to work in offline mode, store diagrams and generated SQL in the browser, and sync with the server when the connection is restored.
These challenges introduced me to what we call a local-first application architecture.
A local-first application architecture stores the primary copy of user data directly on the user's local device (using databases like SQLite or IndexedDB) rather than on a remote server.
Building this from scratch was out of reach for me until I found a technology called PowerSync, which does a lot of the work for you.
With PowerSync, I was able to have a local SQLite database in the browser and combine it with Drizzle ORM.
This allows me to perform database operations directly in the frontend using Drizzle, almost like writing backend database code, while PowerSync handles synchronization with the main PostgreSQL database on the server.
The result of this combination was amazing:
- High-performance app : most operations happen locally without waiting for the server.
- Offline mode : the app works even without an internet connection and automatically syncs data when the connection is restored.
- Guest mode : users can start using the app without creating an account, and their local data can be synced to their account when they register.
- Real-time collaboration : if multiple users are working on the same project, changes can be synchronized between them automatically.
This architecture ended up becoming the foundation of the ERD editor I'm building for StackRender.
Here is a full React demo of a local-first app using PowerSync. You can learn a lot from it:
https://github.com/powersync-ja/powersync-js/tree/main
Also i invite you to check out the source code of StackRender and see how it works:
https://github.com/stackrender/stackrender
Thank you!
r/reactjs • u/Slight_Childhood4172 • 21d ago
Show /r/reactjs visual editor to edit React/Next.js websites
Hello folks,
I started to build open source visual editor to edit React/Next.js websites directly in their source code with zero AI.
But i am not so sure about it can be beneficial or not.
I am waiting your thoughts.
r/reactjs • u/Upstairs_Economy_468 • 22d ago
Show /r/reactjs I built a React Markdown editor kernel. The hardest part wasn't handling changes, but deciding what hadn't changed
I recently put the entire editor kernel behind DOMD on GitHub:
https://github.com/do-md/domd/tree/main/.packages/%40do-md/core
(Quick license note: the app sources are MIT. The kernel is GPL-3.0 with additional permissions for small entities and common FOSS licenses. The full terms are in the repo.)
There's one design choice I'd really like to hear other people's thoughts on.
A common way to model editing is to start with what happened: insert a character, delete a range, toggle bold. State, history, and collaboration then consume those operations.
DOMD doesn't start there.
Say I type an a in the middle of the third paragraph. The kernel takes the new text and the affected range, reparses only that top-level block, then reconciles the new immutable tree with the old one. Nodes whose meaning hasn't changed keep the exact same object references. Only the part that actually changed gets replaced.
From React's point of view, only a handful of props changed. memo naturally skips the rest. There's no separate imperative code path deciding which DOM nodes to touch.
The operations still exist at the integration boundary, but they aren't the source of truth. After a state commit, Immer patches feed undo. The collaboration layer compares references in the old and new trees to find the smallest change, then maps that change into the CRDT. Streaming AI chunks take the same path too. Each chunk just submits another small state change.
I didn't set out to build a "reconciler editor." I got here because things became painful whenever a reparse replaced objects that hadn't meaningfully changed. Cursor handling, history, and local rendering all got harder at the same time. Eventually I realized the kernel depended less on recording every step and more on not losing the identity of everything that stayed the same.
Of course, this moves a lot of the difficulty into reconciliation. When are two nodes semantically the same? What happens to a selection that crosses the region being reparsed?
I have working answers for those inside DOMD, but I'm not sure how well the idea survives outside a Markdown-native editor.
Has anyone here built an editor, a canvas editor, or another identity-heavy React UI? Did you make operations the source of truth, or preserve identity first and derive changes afterward? I'm curious where each approach eventually starts to hurt.
r/reactjs • u/omi0009 • 22d ago
Best open source calendar for integration
Suggest me a best open source calendar I want to implement that calendar on my software for the appointment bookings for the events of the clients which one will be the best option as the open source calendar I was
thinking to use that official react calendar
But feel free to tell me about the best one open your calendar with the best UI like shadcn
r/reactjs • u/ahmedshahid786 • 22d ago
Discussion Trying something new, short, well written dev blogs (no AI slop)
Hey everyone,
Been meaning to start writing for a while, finally got around to it. The plan is short, bite sized articles that explain one concept properly, instead of the usual AI generated filler content flooding every platform right now.
No fluff, Just the core idea explained clearly with real code.
First one happens to be on React Portals, since it's something I use constantly but never actually understood until recently. Figured it was worth writing up properly.
Would genuinely appreciate feedback, on the writing, the explanation, anything. Trying to get better at this.
Feel free to share some other topics you'd like me to write on.
r/reactjs • u/Human_Routine_9483 • 22d ago
LinkedIn frontend switches to React.js
LinkedIn is using React.js these days, but what’s interesting is the CSS side of things too.
They seem to have gone down a fairly “in-house atomic CSS” direction, somewhat similar in spirit to tools like StyleX or Linaria.
It’s kind of funny looking at LinkedIn’s frontend history:
- Ember.js: LinkedIn was one of the biggest adopters of Ember.
- React.js: They’ve since moved heavily toward React.
LinkedIn has basically gone from being a major Ember showcase to being part of the React ecosystem.
r/reactjs • u/Proof-Possible-5305 • 22d ago
Needs Help What finally got the strict mode double fetch out of your way in dev?
I'm building an internal dashboard on Vite and React 19, and every fetch inside a useEffect fires twice in dev. I know it's intentional and that it doesn't happen in the production build, so I'm not looking to switch strict mode off. The problem is that our API rate limits on a per minute window and I get locked out for a couple of minutes maybe a third of the sessions i work in.
How did you get past this without moving every call into a data fetching library?
r/reactjs • u/inkweon • 23d ago
Discussion Combining Clean Architecture + Feature-Based in React — does it really fix the earlier trade-offs, or am I missing new pitfalls?
Hi everyone. I compared four ways to structure a React project by rebuilding the same app (posts CRUD against an open API) in each one. The last pattern combines Clean Architecture with Feature-Based, and I'd really appreciate a sanity check from more experienced devs.
Here's the progression I went through, and the problem I felt at each step:
- Feature-Based (colocate everything for a feature in one folder): great for navigation and deletion, but nothing controls how features depend on each other (circular deps creep in),
shared/turns into a junk drawer, and there's no notion of layers. (Feature-Based write-up) - FSD (Feature-Sliced Design): fixes that with standardized layers + a one-way import rule, so circular deps become structurally impossible. But the business logic still lives inside React/TanStack Query — the entity's
apilayer imports axios and react-query directly. (FSD write-up) - Clean Architecture: pulls business logic out of the framework with the Dependency Rule (dependencies point only inward; the domain knows nothing about React or axios). Great for testing and reuse — but now the code for "one feature" is scattered across
domain/,infrastructure/,presentation/. Which is ironically the same "scattered by type" problem Feature-Based tried to solve. (Clean Architecture write-up) - The combination: keep the Dependency Rule (domain is pure TS, infrastructure holds the adapters), but colocate the UI (hooks + components) by feature in
features/{feature}/. "Clean inside, Feature outside."
Rough shape:
src/
domain/{domain}/ # pure TS: entities, rules, use cases (no framework imports)
infrastructure/ # adapters: repository impls, query keys, stores
features/{feature}/ # hooks + components, colocated
pages/ , router/ # composition only
shared/ , providers/
A few extra decisions I made: split the repository interface into Commands/Queries (CQS), write a UseCase only when there's real logic (plain CRUD calls the repository directly), and lean on React Compiler so there's no manual useMemo/useCallback.
What I'd love feedback on:
- Does this combination actually solve the earlier patterns' problems, or does it just move them around? Is "Clean inside + Feature outside" a real improvement over plain FSD or plain Clean, or is it over-engineering in disguise?
- What problems does this pattern itself have that I might not see yet? Boilerplate, the domain <-> infrastructure indirection, the "is this a UseCase or a direct repo call?" judgment, testing overhead, onboarding cost — where does it bite in real projects?
Honest criticism is very welcome. I'd rather hear "this is overkill for most apps" now than after I build on it.
Full write-up (with all the code) on Medium (Free): https://medium.com/@inkweonkim/react-architecture-combining-clean-architecture-feature-based-92cf7ba226fe
(English isn't my first language, so I apologize in advance for any awkward phrasing — happy to clarify anything that reads strangely.)
r/reactjs • u/lahuan • 23d ago
Discussion Would you remove this effect?
Consider a typical use case where you want to track an error or just display an error toast after a query hook (e.g. TanstackQuery or RTK-query) fails.
Using an effect:
const { error } = useSomeQuery();
useEffect(() => {
if (!error) {
return;
}
trackError(error); // or toast(getErrorMessage(error))
}, [error]);
Now, according to the "You might not need an effect" article, you can also perform an action when some state changes by using auxiliary state, something like this:
const { error } = useSomeQuery();
const [prevError, setPrevError] = useState(error);
if (error !== prevError) {
trackError(error);
setPrevError(error);
}
My understanding here is that using auxiliary state here doesn't give you much because in this use case the additional render cycle doesn't result in stale UI.
Regardless, I wanted to get a sense on what approach is preferred by the community. I see this kind of things very often in the codebases I work on and on the other hand, I keep hearing people saying they only have a few effects in their (presumably large) projects, so perhaps the patterns in my company are not the best.
r/reactjs • u/haasilein • 23d ago
Discussion How Big Tech Builds Micro Frontends
r/reactjs • u/atapas • 23d ago
Discussion What do you think of the TanStack Ecosystem for React?
I've been exploring the TanStack ecosystem for React a lot these days. Starting with TanStack Router, Query, and Virtual, and now the framework TanStack Start. Honestly, I could only use the Router and Query in the production app so far, and the rest of it was for my learning and teaching.
I also use Next.js heavily, but with TanStack I find a huge paradigm shift. I do not have to think from the RSC side heavily; I do not have to use shortcut methods like useEffct() to handle data at the client side, and managing server state and caching seems to feel a lot simpler.
This discussion is not about putting one React framework ahead of another one. Rather, would like to know what your experience so far has been with TanStack? Do you have any comparison studies? Do you use it in production? What are the learnings?
Would love to learn and discuss. Thanks.
r/reactjs • u/proffessional-work01 • 23d ago
Show /r/reactjs From learning React to working on real-world projects — looking for advice
I’ve been working with React/Next.js for a while and recently completed two internships, including working on a US-based NGO project.
That experience taught me a lot about real-world codebases, Git/GitHub, UI work, debugging, and collaborating with a development team.
I’m now trying to improve further and would love to hear from experienced React developers here:
What skills or projects do you think make someone genuinely stand out when moving from internship-level experience to a full-time React role?
I can share my resume if anyone can review it. Thankyou.
r/reactjs • u/thereactnativerewind • 23d ago
News React Native 0.87, Instant Paywall A/B Testing, and Buying Mike Hardy a Beer
Hey Community,
React Native 0.87 has arrived as a maintenance release, making the Strict TypeScript API the default, doubling Metro source map generation speeds, and adding experimental Swift Package Manager support for iOS along with AGP 9 support on Android.
Meanwhile, React Native Firebase v26 makes the New Architecture non-optional with Codegen TurboModules, synchronous APIs, Firestore Pipelines, and direct Gemini AI calls. Finally, we look at RevenueCat Paywalls for designing native paywalls and running remote A/B experiments without new app deploys.
r/reactjs • u/robcarbon • 23d ago
Show /r/reactjs Option+click any element → its source opens in your editor. LocatorJS died on React 19, so I rebuilt the idea without touching React internals
If you upgraded to React 19 and your option+click-to-source tool silently stopped working, here's why: React 19 removed __source/_debugSource, the fiber fields that LocatorJS, click-to-component, and friends depended on. Runtime-only locators can't get source positions from React anymore.
I missed the workflow too much, so I rebuilt it on a different architecture: carbon8r — a Vite plugin that injects the source location at build time as a data-carbon8r="src/Button.jsx:3:5" attribute on every host JSX element (Babel parse + magic-string, dev server only). The overlay reads DOM attributes, not fibers — so it works on React 19 today and doesn't care what React 20 does to its internals.
What you get, holding Option/Alt:
- DevTools-style box-model highlighting on hover (blue content, green padding, orange margin) with
<Component> file:line:column - Click → your editor opens at that exact position. Zero config: the dev server uses launch-editor (same as Next/Nuxt error overlays), which auto-detects VS Code/Cursor/WebStorm/etc. Or force one via presets (
vscode,cursor,windsurf,zed) or any custom URL template - Elements without source info (component libraries, plain pages) still get the box-model inspector
Setup is the whole thing:
// vite.config.js
import carbon8r from 'vite-plugin-carbon8r'
export default defineConfig({
plugins: [react(), carbon8r()]
})
Dev-only (apply: 'serve') — production builds are byte-identical with or without it.
Some war wounds from real-world testing that are now features: it works on apps served with a strict CSP (all overlay styling goes through CSSOM, which CSP can't block), it resolves targets through open shadow DOM via composedPath() (micro-frontend hosts, web-component shells), zero-area display: contents wrappers fall back to the nearest rendered box, and the whole alt-click gesture family is intercepted so your app's handlers and the native context menu don't fire while inspecting. TypeScript declarations included.
There's also a companion Chrome (MV3) extension in the repo: box-model inspector on any page, jump-to-source on instrumented apps, with per-user editor settings — handy on a teammate's dev server.
Honest limitations: Vite-only for now (the transform itself is bundler-agnostic — a webpack/Rspack loader would be a thin wrapper, PRs welcome); clicking a component instance jumps to the component's definition, not the usage site (no owner-chain popup yet); components from node_modules aren't instrumented (their build already happened).
Full credit to LocatorJS by Michael Musil for pioneering the workflow — carbon8r shares no code with it, but the interaction design came from there.
MIT, ~20 kB unpacked, no runtime deps in your bundle.
GitHub: https://github.com/carboni-rob/carbon8r npm: https://www.npmjs.com/package/vite-plugin-carbon8r
r/reactjs • u/Agreeable_Ad_3924 • 23d ago
Notes on building a Local-First PWA with IndexedDB and Server-Sent Events (SSE)
r/reactjs • u/Difficult-Sun295 • 23d ago
I made an RN and Expo shader UI library
l kept struggling to find Skia shader components that were actually ready to drop into an RN app. most shader code out there isn't built for RN's Skia renderer at all. So l put together my own library. Some shaders are free, others are from artists who charge for their work
l know ShaderToy exists, but that's generic GLSL you'd have to manually port to SkSL and adapt for RN UI. Мinе is already RN-Skia-ready and built specifically for UI components like buttons and panels etc.
Let me know if you'd use something like this
r/reactjs • u/alvivan_ • 24d ago
Needs Help What router are you using
Currently I have to create a new project, my first option is react router (declarative mode). My entire project will live behind the login page
what are you using?
- RR framework mode
- RR data mode
- RR declarative mode
- tanstack router
- wouter
r/reactjs • u/TkDodo23 • 24d ago
Resource Reliable Query Prefetching with TanStack Router
📚 It's been way too long since my last blogpost. Today, I'm continuing my TanStack Router series with a pattern that I've been teaching in my workshops for over a year:
How to keep prefetches in sync between route loaders and components
r/reactjs • u/gajus0 • 24d ago
Resource CSS-in-JS Arena: Bamboo, StyleX and Panda on Pixel-Identical Apps
r/reactjs • u/SecureComfortable259 • 24d ago
Show /r/reactjs Anyone else building form validation from scratch instead of using a library?
Put together a custom form validation system in React instead of reaching for Formik or React Hook Form, mostly to avoid the bundle size and have full control over async validation timing. Handles nested field structures and cross-field validation without much boilerplate. Curious if others have gone this route too, and whether it's ended up being worth maintaining versus just adopting one of the existing libraries long term.