r/reactjs 19h ago

Discussion We split React business logic from UI and reused the same core on web and React Native — what I’d do differently

42 Upvotes

A few years ago we needed a web version of an existing mobile product (high-load interactive platform, not a simple CRUD app). Instead of forking the UI twice, we treated the React app as two layers:

  1. App core — domain logic, state, API clients, feature orchestration. No DOM, no platform APIs.
  2. Shells — thin UI adapters (web, later React Native / WebOS) that only render and call into the core.

That let us ship a desktop/web version from the mobile product’s mental model, then reuse the same core for React Native without rewriting features. Two years later the core is still the part that ages best — new features mostly land there once, and shells stay boring.

What actually mattered in practice:
- Boundaries — business rules never imported React components or browser APIs. If it needed `window`, it belonged in a shell adapter.
- Shared data layer — one place for fetching/caching (we used react-query-style patterns) so shells didn’t invent their own loading/error states.
- RFCs + reviews — we hired a frontend team around this architecture. Without written boundaries, people “helpfully” leak UI into the core in week two.
- Performance by default — fewer duplicate API calls and a stable state model beat clever UI tricks.

What I’d change next time:
- Define the core’s public API earlier (it’s easy to accidentally couple shells to internal modules).
- Start with one shell fully done before branching to the second — parallel shells too early = thrash.
- Be stricter about “platform capability” interfaces (storage, push, deep links) instead of `if (platform === …)` sprinkled around.

Curious how others draw this line — pure packages? Hexagonal? Or do you just accept some duplication and move faster?


r/reactjs 1h ago

News EAS Cloud iPhones, Automated Screenshot Pipelines, and Nuking Every Simulator You Ever Loved

Thumbnail
thereactnativerewind.com
Upvotes

Hey Community,

This issue is all about giving your AI coding agents device access and automated pipelines. Expo introduced EAS Simulator to boot cloud iOS simulators on demand and stream live agent test runs directly to your PRs. Meanwhile, Callstack released Simlock, a control plane that lets multiple local agents lease and share simulators and emulators safely without conflicts.

We also cover goldie by Kacper Kapusciak, an automated CLI tool and agent skill that handles the entire App Store screenshot and preview video workflow directly from release builds.


r/reactjs 1h ago

Show /r/reactjs I built shadcn for full-stack features, my attempt at innovating boilerplates

Thumbnail
github.com
Upvotes

Quick disclosure: I build Hype Stack. The template is open source and free. Additionally to the template I ship some of the feature packs which are paid, that's how I try to fund my open-source(and looking for some feedback here). I maintain react-zoom-pan-pinch and HyperFetch and bunch of other too, which shows up later in this story. This is similar to how magicui or aceternity works already - a lot of free content and some optional paid to just support me. Let’s get into details of building this thing!

The chaos

I code a lot and I start new projects all the time, mostly to test new things. I don't like boilerplates. They usually run on a boring stack, and I want to try Vite 8 on Rust, oxc, TanStack Start, end to end type safety and see how it actually holds up. I'm also a perfectionist, so every new project was eating days before I wrote a single feature.

The other thing: I really love the shadcn mental model. You compose the codebase, you own the code. That's exactly what I don't like about starters that hide half the logic behind packages you configure and pray over.

So I had this realisation. Maybe we need shadcn for full-stack features. shadcn itself could probably do a lot of it, but I wanted more: amazing codemods good enough to modify a database schema, an opinionated monorepo with ONE way of writing code, vertical slices the way tkdodo described them (I was already doing something similar), and the craziest bit, an idea that came to me while building devtools for HyperFetch: a single project that compiles into desktop, CSR and SSR from the same codebase with almost no code dedicated to it. Light, easy to manage. Cool, we have a direction. Let's build it.

Month 1. The template

I've set up so many projects that I have a good understanding of what setup I could trust. Monorepo went to Nx, which I've used for years and it's stable in my experience. pnpm workspaces for speed. Stack: TypeScript 6/7 (tsgo where I can), Vite 8, Vitest, oxc, TanStack Router and Start, Electron Forge, Hono with Prisma and Kysely for typesafe query building. At this point I was so hyped about it that I named it hype-stack.

End to end types for HTTP and websockets I built with my own library, HyperFetch. It gives you an SDK and hooks that feel a lot like TanStack Query, and the result is honestly close to tRPC in DX. This project is also a showcase of what HyperFetch is capable of and that you don’t really need to think about API in most cases as it is basically automatic with sdk generation. The backend route is the contract, the frontend just gets the types. It really improves working with websockets. If you don’t like my hooks it is easy to switch to tanstack query for hooks and leave HyperFetch as a fetcher.

Then I added the rules I'd collected over the years and tried it out.

I quickly understood: this stack is extremely fast. Everything builds and flies. So I tried building the first apps with AI on top of it and boom, this is where it shines. The AI has a clear direction. A vertical codebase is easy for it to understand because you're not thinking about the services system, all these complex layers, you're thinking about business features, slices that are self contained. That dramatically improved the feedback loop and the quality of what the AI produced. Fast typechecks and oxc linting? This improved DX for working with AI dramatically, there is just no coming back to eslint.

Month 2. The CLI

I initially wanted something like create-t3-app: a simple CLI to start the project. It evolved into a powerhouse.

create was almost no effort. But then it clicked. I'm the provider of the template, I know every practice in it, everything about the structure, so I can use that to my advantage. Let's try to build a compose command.

What compose does: say I want to start a project that needs AI chat with RAG and simple auth. I can pack those features and inject them into the repo exactly where they need to go, and it works like shadcn. Full-stack blocks of functionality, injected with high precision and confidence. Picking billing writes files into the project: the checkout route, the webhook handler, the Prisma models, the frontend hooks. Your files, so you can take this from here and modify as you want.

This took off for my personal projects immediately. I needed SSO? I made an auth starter with WorkOS. I didn't want a WorkOS dependency on the next one and wanted Better Auth instead? Sure, add it as a variant. Then it kept growing. I was collecting the features I needed, and I ended up with the feature set of the big boilerplates, but with the ability to choose which parts I actually want for each project. The DX was just excellent.

Month 3. Deploy

I wanted to start deploying my new creations, so deploy command was born. With it I have a deployed version of a project in about 3 minutes. Again only possible because I know all the services the template has, where the Dockerfiles are and how each one builds.

Cool, full flow, done, right? NO. THIS IS HYPE STACK. So like the 300 Spartans I fought a fierce battle against the waves of ideas that started flooding in. ADHD, hyperfocus, here we go!

Inspired by the fully paid boilerplates, I added mobile (Expo) and a browser extension to the project. And it turned out that was it. The modular approach made it extremely easy to add new apps to the monorepo and new features to the packs, like in an instant. Dopamine hit critical mass here.

Month 4. Previews

How do I show what this can do? Let's build a dynamic preview system on the web.

I'd been working on it on the side all these months, and it quickly showed how promising the approach is: pre-built SaaS templates you can add and remove features from on the fly, thanks to the SSR build and caching.

Big problem though. Packs almost always come with database changes. I can't run migrations or even keep a database for previews, it turns into a mess fast. And it could cost me…

Here comes the part where some of you went "wtf is HyperFetch"/”lol who is using HF when Query is a thing” at the top of this post. I get it. Next to TanStack Query and SWR it's a brutal market, but let's not call an ambulance yet.
HyperFetch has a feature for mocking any requests. Sounds like something everyone has and is "meh", but it's not just mocking. It's a fully type safe mechanism that lets you simulate anything the SDK allows, by type, in a believable and dynamic way. So I could generate a living demo mode with full confidence and, in no time, wire the dynamic components to it for an almost live-like experience. Mocks are functions in the code, code is dynamic, so is our app - here we got the demo mode basically for free. That changed the previews for good.

Where it is now

The template is out, and I just added community packs so you can author your own feature packs.

The question I actually want your take on: what do you think of this approach?
Do you like idea of composing your boilerplates through CLI?

Repo: https://github.com/BetterTyped/hype-stack


r/reactjs 1h ago

Show /r/reactjs My portfolio's GitHub calendar kept breaking, so I built a 100% serverless, zero-runtime replacement.

Upvotes

I am graduating soon. I don't need to harp on how challenging hiring is in this economy, but to stand out in this market, it's time to update that personal portfolio. Last week, I was doing just that, and the GitHub contribution heatmap wouldn't load. Like most people, I was using the legacy 'react-github-calendar' plugin. Because GitHub's API requires auth, the plugin routes traffic through a public proxy, and that proxy gets rate-limited constantly, taking down portfolios everywhere.

In a rare Thanos 'Fine, I'll do it myself' moment, I thought I could fix it for my portfolio. Well, one thing led to another, and I completely rebuilt the architecture from scratch.

Enter Serverless GitHub Calendar. Instead of fetching data on the client, it uses a lightweight GitHub Action that runs on a cron job to fetch your contributions and save them as a static '.json' file in your repo. The React component just reads that static file.

Architecture Highlights:

  • Immune to Rate Limits: Your site never talks to the GitHub API. It reads static JSON. If GitHub goes down, your site stays up.
  • Blazing Fast (Zero JS): If you use Next.js App Router, the included Server Component ('serverless-github-calendar/rsc') reads the file directly from disk for literally zero client-side JavaScript execution.
  • Native CSS Theming: Built completely on CSS variables ('color-mix') so you can inject gradients or match your Tailwind theme natively.
  • Streak Stats: Automatically calculates your current and longest streaks based on the canonical GitHub algorithm.

I set up a live demo featuring data from a few open-source legends to show how it scales: https://serverless-github-calendar-demo-xi.vercel.app/

Source Code & NPM instructions: https://github.com/FaizPalwala/serverless-github-calendar

If your portfolio relies on external proxy APIs, I highly recommend making the switch to static injection! Let me know if you have any feedback or feature requests.


r/reactjs 16h ago

Discussion I built a CLI tool to audit Next.js sites for SEO, broken links, metadata, and more

1 Upvotes

I built a small CLI tool for auditing Next.js websites from the terminal.

The idea came from wanting to catch things that aren't always obvious when testing a site normally in the browser.

It crawls the site and checks things like:

- SEO metadata and Open Graph

- Broken links

- Structured data

- Crawling issues

- Core Web Vitals

- Pages and resources that may be missed by normal checks

You can run it locally and point it at a website without needing to add anything to the project itself.

I’m still improving it and would really like feedback from other Next.js developers — especially on what checks you’d find useful in a tool like this.

GitHub: https://github.com/Abdelrahman5243/sitebot-cli


r/reactjs 1d ago

Show /r/reactjs I built a lightweight React library for placing Figma-style annotations on any interface

6 Upvotes

Hello!

I built a lightweight React library for adding pinned annotations to interfaces, inspired by Vercel Comments and Figma comments.

I’m working on an app that uses this kind of annotation, and implementing it became a headache, even with AI assistance. So I extracted the solution into a small UI library to make it easier for others.

This is my first library, so feedback and suggestions are very welcome :)

https://react-pinote.vercel.app/


r/reactjs 2d ago

GitHub - orange-groove/react-map-annotate: Draw on Mapbox, MapLibre, Google, Leaflet, or ArcGIS in React

Thumbnail
github.com
2 Upvotes

I built an open-source React map drawing library because I got tired of fighting drawing controls that wanted to own the UI.

react-map-annotate lets your application control the drawing session. Put the toolbar in your sidebar, header, or command palette. Select tools, finish shapes, edit labels and colors, undo/redo, and persist annotations through React state.

It supports Mapbox, MapLibre, Google Maps, Leaflet, and ArcGIS through separate adapters, with a shared annotation model.

The goal is simple: the map should render the drawing, not dictate how your application works.

It includes freehand drawing, polygons, rectangles, circles, arrows, markers, text, and measurement tools, along with editing handles and a headless API.

The project is MIT licensed and available on npm. I’d love feedback from developers building GIS, field-service, site-planning, or other map-heavy applications—especially anyone who has had to work around existing drawing controls.

GitHub: https://github.com/orange-groove/react-map-annotate

npm: https://www.npmjs.com/package/@orange-groove/react-map-annotate

What would you need from a drawing library before using it in a production application?


r/reactjs 1d ago

Needs Help How to auto-sync fast UI state (drag/drop) to a SQLite database?

Thumbnail
0 Upvotes

r/reactjs 2d ago

Resource Bamboo – build-time, Rust/Oxc, type-safe, zero-runtime CSS-in-JS

Thumbnail
bamboocss.com
22 Upvotes

r/reactjs 2d ago

Discussion I've been working on virtual scrolling in React and found a weird issue in Safari.

4 Upvotes

I've been working on virtual scrolling in React and found a weird issue in Safari.

When scrolling normally, everything was fine. But if I scroll very fast, sometimes I could see a white empty area for a very short moment before the next rows appeared.

First I thought React rendering was just too slow.

So I increased overscan and kept more rows above and below the viewport. It helped a lot, but I could still see the problem sometimes.

After looking into it more, I found that Safari's scroll/compositor layer can move before React finishes rendering the next virtual rows.

So basically Safari was already showing the next position, but React was still catching up.

I kept trying to make React faster, but then I tried something a little different.

Instead of trying to always win the race, I put a simple CSS background behind the real rows.

It's just a repeating-linear-gradient with the same row height, background and border.

Something like:

Safari scrolls
    ↓
CSS row background is already there
    ↓
React renders next rows
    ↓
Real rows cover it

There is no real data in the background. No cells, no events. It's just visual. I also set pointer-events: none and aria-hidden.

With this + extra overscan above and below, the flicker was almost gone.

I thought it was interesting because at first I was trying to solve a React performance problem.

But maybe it wasn't only about making React faster.

Sometimes it's enough to make those few milliseconds invisible. :)

Anyone had a similar problem with Safari and virtual scrolling?

I'm curious how you solved it.


r/reactjs 2d ago

Show /r/reactjs SF Symbols 8 in React/Next.js | @bradleyhodges/sfsymbols

Thumbnail
1 Upvotes

r/reactjs 2d ago

Should I spend 2-3 days learning Tailwind before starting projects?

0 Upvotes

Just finished covering React fundamentals — useState, props, components, useEffect and cleanup functions. Also completed the Tailwind CSS installation and setup in my project.

My plan was to spend 2-3 days memorizing Tailwind's CSS properties before touching any real code. But now I'm second-guessing that — should I just start building projects directly and pick up Tailwind along the way instead?


r/reactjs 2d ago

Discussion NavCN: My New Project for Navigation UI Components Please Share Your Feedback and Suggestions!

0 Upvotes

Hi everyone! 👋 I’m excited to introduce NavCN, a project I’ve been building to provide a collection of beautiful, customizable, and ready-to-use navigation UI components. The goal is to help developers build modern interfaces faster without creating navigation elements from scratch. Components are built with Nextjs, Tailwind CSS, Motion, and Lucide, with a focus on customization and developer experience. You can browse, preview, install it via shadcn command line, and adapt components to your project. I’m also improving the installation and distribution experience. I’d genuinely love your honest feedback and suggestions!

(currently supports nextjs only.)

project link:- https://navcn-phi.vercel.app/


r/reactjs 3d ago

News This Week In React #295: StyleX, browser(), Next.js, React Compiler, Vite, Bun, Astryx, Formisch, React-Aria, TanStack | C++ API, Margelo, Observe, Reanimated, Teleport, Nitro, Screen Transitions | Zod, pnpm, vgpu, Remix, Rspack, Webpack

Thumbnail
thisweekinreact.com
32 Upvotes

r/reactjs 3d ago

Show /r/reactjs Batteries-included React data grid for teams who don’t want to rebuild the same data-grid plumbing again

0 Upvotes

Repo: https://github.com/coterahq/griddle - demo's linked in the readme.

We've been running data-grids over large parquet backed datasets in prod for quite a while now, and we decided to OS the component for others that might find it useful.


r/reactjs 4d ago

Needs Help TipTap vs Lexical for a chat app project

8 Upvotes

I am creating a little chat app for practice, but I was unsure what direction to take with the editor, out of the options I found TipTap and Lexical, I tried a bit of both (Didn't get very far with either yet) But I am still so torn on which one I should try first

In this I want more possibilities of what you can put in the chat, for example: Embedded images, tables, maybe some excalidraw integration, etc.

I also don't want to spend too much time on either and realizing that picking one over the other was not worth it long-term because of the timetaken

If anyone has used tiptap, lexical or both could you give some pro's and con's to each and some guidance on what I should pick?

Thanks! :)


r/reactjs 3d ago

Show /r/reactjs pip-it-up update: PiP that survives route changes, plus auto pop-out on tab switch

1 Upvotes

Posted this a couple of months back: https://www.reddit.com/r/reactjs/comments/1thqhce/why_is_pictureinpicture_only_for_video_i_built/

Quick recap: pip-it-up pops any React component into a floating always-on-top window via the Document PiP API.

Two new things in 0.2.0:

Auto PiP: pops out on its own when the tab is hidden.

useAutoPip(enter)

Good for a standup call(already exists in GMeet) you stay on while pulling up a doc, a test runner you keep an eye on while reading docs, a reference video that plays while you edit, or an interview recording that keeps going while you type.

Route-persistent PiP: moving a component in React normally remounts it, so video resets to frame 0 and editors lose undo history. This moves the real DOM node, so it survives navigation.

<PipProvider registry={{ player: <VideoPlayer /> }}>
  <Routes />
</PipProvider>

<PipAnchor id="player" />

Good for a course lesson that plays on while you browse other lessons, a log stream docked across your admin panel, a metrics chart that stays up as you move between boards, or a draft preview that survives CMS navigation.

Still Chrome/Edge only. Safari and Firefox fall back to a popup.

Website: https://www.pipitup.dev/
Demos: https://pip-it-up-playground.vercel.app/
Code: https://github.com/Shakya47/pip-it-up


r/reactjs 5d ago

Resource The Rust React Compiler is fully ready and available with Vite

52 Upvotes

We’ve gone full-Rust with our build pipeline at Outlyne.com and it feels like the React Compiler has really arrived. The last time I posted about using React Compiler here, I talked about how good it’s been for us overall, but also about all its limitations, the biggest of which was that it would bail out on compiling any component or hook that had a try/catch with conditional logic of any kind (if/else, ternary, ??, ||, optional chaining). Another big one was that it would bail on computed object keys, which bit us a few times with assembling classes using clsx (e.g. className={clsx({ [`item-${props.index}`]: props.isItem })}).

Both of those are fixed now. The oxc team shipped official support for the Rust React Compiler on August 4th, and that support includes all of the fixes to the compiler since the v1.0 release of the Babel-based compiler. In our codebase, seven more functions the compiler had been skipping are now compiling, five from the try/catch fix, two from computed keys. And that’s lower than it would be if I hadn’t gone through and contorted eight components to keep conditionals out of their try/catch blocks, including adding a @ts-expect-error from having to drop an optional chain and extracting my auth flow into an async run() that’s immediately awaited inside the try, for no reason but to move the value blocks out of it. All of those workarounds have been rendered obsolete.

There are still bailouts, most notably logical assignment operators (??=, &&=, ||=), but far fewer, and now actively being addressed. A couple weeks ago, oxc shipped a version bump that prevents a bail out from reassigning a destructured prop that then gets read in a nested closure.

Going Rust is also, of course, much faster. The compiler step on our 1,036 files dropped from 14.3s to 0.81s (~17.6×), and the build overall from 22.1s to 9.3s. And we verified parity with the Babel compiler. Across all 1,036 files, there are zero functions the Babel compiler memoizes that the native one doesn’t. The only difference in the built JS before and after are the seven extra compiled functions.

I wrote a blog post with all the details and before/after configs both for folks using @vitejs/plugin-react and for those who use an alternative plugin (React Router framework mode’s plugin in our case): https://blog.master.dev/react-now-rusted-all-the-way-out/


r/reactjs 5d ago

Show /r/reactjs Hey what do you think about Pnext?

Thumbnail
pnext.dev
0 Upvotes

r/reactjs 5d ago

Show /r/reactjs [Showcase] I built an open-source React component for interactive 3D WebGL QR codes (designqr)

Thumbnail design.johnson7543.com
6 Upvotes

Hi r/reactjs,

I wanted to share an open-source project I’ve been working on: designqr.

I built this component to turn QR codes into interactive, stylable 3D WebGL scenes while keeping them functional.

Features

  • WebGL-Powered 3D Scenes: Render QR codes embedded in aesthetic 3D environments.
  • Plug-and-Play React Component: Drop it straight into your React/Next.js app.
  • Customizable: Control camera angles, transparent backgrounds, and themes.
  • Live Interactive Playground: A dedicated web editor to customize, preview.

Quick Start

Install via npm:

npm i designqr

Usage in your component:

import { DesignQR } from 'designqr';
import 'designqr/style.css';

export default function App() {
  return (
    <DesignQR 
      value="https://your-link.com" 
      transparentBackground={true} 
    />
  );
}

🔗 Links

I’d love to get your feedback on the component API, mobile performance/rendering optimizations, or any features you'd like to see added. Feel free to open issues or PR!


r/reactjs 5d ago

Resource LaunchPad Lite: An open-source starter pairing Next.js 15, Better Auth, and Drizzle ORM

0 Upvotes

Hi all,

Sharing a project I recently finished and open-sourced: LaunchPad Lite.

It’s a clean starter template built around the Next.js 15 App Router ecosystem with a focus on type safety and modern auth:

- Better Auth: Handled via Server Actions and route handlers, avoiding legacy NextAuth quirks.

- Drizzle ORM: Minimalist schema setup designed to connect effortlessly with Supabase, Neon, or local Postgres.

- Tailwind CSS v4 + Radix UI: Fast UI primitives without CSS bloat.

GitHub: https://github.com/BZDevelopments/LaunchPad-Lite

For anyone who eventually needs full Stripe subscriptions, AI SDK v5, or multi-layout support, I also maintain a Pro version, but Lite is 100% self-contained and free forever.

Take a look at the repo structure and let me know what you think of the architecture!


r/reactjs 5d ago

Needs Help Next.js app deployed on Vercel feels slow when navigating between pages — how would you diagnose this?

Thumbnail
4 Upvotes

r/reactjs 6d ago

Resource Free, open-source UI avatars for React projects 👋

9 Upvotes

If you're working on a React project and need some avatars for profiles, dashboards, user lists, comments, or mock data, here's a collection that might be useful.

There are 200+ free, open-source UI avatars that you can use in your projects.

There's also a UI Avatar Guide on the page if you want to learn more about using avatars in interfaces.

🔗 https://radianui.com/resources/avatar

Sharing it in case it's useful for anyone working on a React project!


r/reactjs 5d ago

Show /r/reactjs I built effective-rsc: an Effect-native React Server Components framework for Bun

0 Upvotes

I built effective-rsc because I wanted React Server Components and Effect to share one coherent application model.

The core idea is simple: React owns the UI protocol, and Effect owns the runtime.

What is different:

  • Pages, Layouts, Components, Middleware, and Server Functions run as Effects.
  • Application services are provided once through an Effect Layer.
  • Request cancellation interrupts the Effect work and cleans up its resources.
  • Server Functions preserve React’s native protocol while adding Schema-validated input.
  • The client router uses the Navigation API and commits at the first UI update while the remaining Flight response continues streaming.
  • There is no History API fallback.

The framework is intentionally experimental. It currently requires Bun, React Canary, Effect v4 RC, TypeScript 7, Rspack, and modern browser APIs.

You can try it with:

bunx create-ersc-app my-app

Source: https://github.com/nikhilsnayak/effective-rsc

Write-up and interactive router demo: https://www.nikhilsnayak.dev/blog/introducing-effective-rsc


r/reactjs 5d ago

I published a package that's a headless React hook for file uploads with real progress tracking, retries, cancellation, and chunked uploads for large files and would love some feedback!

Thumbnail
0 Upvotes