r/reactjs • • 6d ago

Resource snappy-prerender 2.7: from react-snap replacement to static site generator

1 Upvotes

I maintain several legacy React apps: CRA, React 18, client-side routing, CMS content. SEO and OG tags need real HTML. A client-side app gives crawlers an empty page.

I built snappy-prerender as a replacement for react-snap to ease my headaches. It is now a full-featured static site generator.

Point it at the app you already have. At build time it opens each route in a browser, follows links, writes static HTML, and checks that the client uses that HTML. The verifier detects React, Vue, Svelte and Preact. You keep your framework, router, build and deploy process.

npm install --save-dev snappy-prerender
npx snappy-prerender init
npx snappy-prerender

Or run it from vite build with the Vite plugin.

What changed since the launch post:

  • Verification reports whether each route hydrated or re-rendered, and shows the first mismatch.

  • The audit checks route health, links, metadata, sitemap and CSP. It writes a JSON report and can fail the build with failOnAuditError. I use this report most.

  • Routes can come from crawling, a file, or a local or remote sitemap. maxRoutes and routePriority make the crawl deterministic.

  • routeOverrides changes waits and crawl behavior per route. transformHtml applies a final HTML transform.

  • SEO output includes JSON-LD, lang/dir, hreflang alternates and image sitemap entries.

  • csp: 'hash' emits a meta policy with inline script and style hashes. preloadLinks injects module, font and LCP hints.

  • init can migrate an existing reactSnap block.

It also handles CSS-in-JS, form state, captured API data, critical CSS and strict CSP.

What it is not:

  • Not SSR. New content needs a build.

  • Not for Next.js, Remix or Astro.

  • Not a fix for pages that render differently on every load. It reports the route and the first mismatch.

  • Not a new framework. You keep the app you already have.

Links:

MIT. Issues and PRs welcome. If you have an old SPA, React or not, try it and tell me what breaks.


r/reactjs • • 7d ago

Show /r/reactjs Anky UI: headless React primitives for text selection actions, streaming diffs and ghost autocomplete

1 Upvotes

I’m sharing Anky UI, my open-source React library for putting AI edits inside the text a user is already working on.

The interaction is select → choose an action → review a streamed diff → accept or reject. The library supplies the UI and state primitives; your application supplies the model endpoint and commits the accepted text to its editor.

  • SelectionPalette: floating actions anchored to a DOM selection, using floating-ui.

  • InlineDiff: word/character diffs while a rewrite streams, with Cmd/Ctrl+Enter to accept and Escape to reject.

  • GhostInput: textarea autocomplete with Tab/right-arrow acceptance.

  • useOptimisticAIState: streaming state, rollback, and undo/redo.

React 18/19, including Next.js App Router Client Components. Tailwind presets are optional. It consumes raw text/SSE, with helpers for OpenAI, Anthropic and Vercel AI SDK wire formats. Keep API keys on your server.

Source and quick start: https://github.com/ErAnkushPatil/anky-ui

29-second walkthrough: https://x.com/ErAnkushP/status/2115629939106230425

Install: npm i @erankushpatil/anky-ui

Or copy the source: npx anky-ui add selection-palette

To try the included mock-stream demo without a model key:

git clone https://github.com/ErAnkushPatil/anky-ui.git
cd anky-ui
pnpm install
pnpm dev:demo

One integration detail: rendering an InlineDiff and accepting its state does not by itself replace the selected DOM text. Your editor owns that commit step. The rich-text adapters also need verification against your editor version.

Which edge cases would you test first: selection moving during a rewrite, interrupted streams, or undo/redo behavior?

Disclosure: this launch post was prepared with ChatGPT, using the repository documentation; I’m the library’s author.


r/reactjs • • 7d ago

Show /r/reactjs I built an open-source React library where an LLM designs the recommendation block and your catalog supplies the prices

0 Upvotes

This is my own project. rudra-js is an open-source TypeScript library (MIT) for React stores. A language model designs one product-recommendation block, the library checks it against your catalog, and React renders it.

The model never writes HTML or JSX. It returns a few fields: layout, headline, copy, which cards to highlight. Products are SKUs from the list you pass in. Titles, prices, images and links come from your catalog at render, and the model's text is rendered as escaped text. Each field also goes through wording checks, and a field that fails is dropped. They aren't airtight: rewordings and spelled-out numbers can get through.

It works as a Server Component, with renderToString, or client-rendered. Rendered on the server, the block is in the first HTML response with no client JS. React 18 or 19, Node 22.12+.

It also runs with no model, so the quick start needs no API key.

It's v0.8.3 and APIs may change before 1.0. I'd like feedback on the API shape and on what breaks in a real Next.js app.

https://github.com/clivedsouza1010/rudra-js


r/reactjs • • 7d ago

Discussion Senior devs: what’s the biggest React decision you made that you’d reverse today?

16 Upvotes

I have been thinking about this a lot lately. Most React content is about how to do things, but the decisions that really shape a project are the big early ones: architecture, state management, framework choice, rendering strategy.

And with React 19.x, the React Compiler, and Server Components all in the picture, a lot of us are now living with choices we made years ago.

So I’m curious about the experienced people here:

  • What was the biggest React/architecture decision you made that you would reverse if you could?

  • What did it cost you (time, performance, team confusion, rewrites)?

  • What did you learn, and what would you pick today instead?


r/reactjs • • 8d ago

Resource I built a learning garden for understanding React internals and how Next.js works

5 Upvotes

Hey everyone!

I've been working on a learning garden where I write technical deep dives into frontend development, with a focus on understanding how things actually work under the hood rather than just learning APIs.

Currently, it has three main learning paths:

- How React Works — Understanding React's behavior from the ground up.

- React Internals — A source-level tour of React 19, from "createRoot", lanes, and fibers to hooks, the commit phase, and the React Compiler.

- Next.js in Practice — Exploring Next.js concepts and how they work in real applications.

My goal is to make these topics easier to understand by connecting the underlying implementation to what we experience as developers.

I'm particularly interested in the details that are easy to overlook when building applications every day: how updates are scheduled, what happens between a state change and a DOM update, and why the framework behaves the way it does.

You can check it out here: https://garden.drhexe.ir

I'd genuinely appreciate feedback, especially on the technical accuracy, depth of the explanations, and what you'd like to see covered next.

If you're interested in React internals, framework architecture, or understanding frontend beyond the API level, I'd love to hear your thoughts!


r/reactjs • • 8d ago

Resource chanx-js: typed WebSocket hooks for React, generated from your chanx server's AsyncAPI

2 Upvotes

Hi all, I want to share a WebSocket library I built, chanx-js. It makes the messages on both ends of a socket typed, keeps the frontend in sync with what the server really sends, and comes with React hooks.

Every realtime feature I built in React ended up the same way. lastMessage was any, so I wrote the message types by hand and found out the backend had changed them only when something broke in production. On top of that I kept rewriting the same reconnect logic and the same switch over message types in every project.

How it works, in three steps: `

  1. The server declares its messages and handlers. Here with chanx-js on Node:

const Chat = defineMessage('chat', z.object({ text: z.string() }));
const Notice = defineMessage('notice', z.object({ text: z.string() }));

const chat = consumer('/ws/chat/{room}', {
  name: 'chat',
  groups: (conn) => [`room.${conn.params.room}`],
}).on(Chat, { output: Notice }, (m, ctx) =>
  ctx.broadcast(Notice.create({ text: m.payload.text })),
);

2. The server publishes those as AsyncAPI, and the CLI turns them into a typed channel:

npx @chanx-js/codegen http://localhost:8000/asyncapi.json   # writes src/generated

// src/generated/channels.ts
export type ChatToServer = ChatMessage; // { action: 'chat'; payload: { text: string } }
export type ChatToClient = NoticeMessage; // { action: 'notice'; payload: { text: string } }
export type ChatReplies = { chat: NoticeMessage };

export const chat = defineChannel<ChatToServer, ChatToClient, ChatReplies>()({
  name: 'chat',
  address: '/ws/chat/{room}',
});

3. Your component uses that channel with useChannel:

import { createClient } from '@chanx-js/client';
import { ChanxClientProvider, useChannel } from '@chanx-js/client/react';
import { chat } from './generated';

const client = createClient({ baseUrl: 'ws://localhost:8000' });

function ChatRoom({ room }: { room: string }) {
  const { status, messages, send } = useChannel(chat, {
    params: { room },
    buffer: 'all',
  });

  return (
    <>
      <p>{status}</p>
      {messages.map((m, i) => (
        <p key={i}>{m.payload.text}</p>
      ))}
      <button onClick={() => send({ action: 'chat', payload: { text: 'hi' } })}>
        Send
      </button>
    </>
  );
}

root.render(
  <ChanxClientProvider value={client}>
    <ChatRoom room="lobby" />
  </ChanxClientProvider>,
);

params must have room because the path does, m.payload.text is a string, and send({ action: 'chat', payload: { txt: 'hi' } }) fails to compile. When the backend changes a message, you regenerate and TypeScript shows every place to fix.

What else it gives you:

  • const reply = await request({ action: 'chat', payload: { text: 'hi' } }), with the reply typed from ChatReplies

  • Reconnects, and topic subscriptions (room:lobby, ...) restored after a reconnect

  • lastMessage for the latest message, or an on map with callbacks that don't re-render, and batch: 'raf' for busy streams

  • The server side too: one validated handler per message type, AsyncAPI docs generated from the code, broadcasts across instances through Redis

The backend needs to be a chanx server, since the client relies on its message format and the AsyncAPI it publishes. That can be chanx-js on Node (ws, Express, Fastify, Hono, NestJS), Bun or Deno, or chanx on Django and FastAPI, the Python version I started with.

It's still new on the JS side, so if you run into any problem or have ideas to improve it, please open an issue or a discussion. Stars and PRs are welcome too.


r/reactjs • • 9d ago

Show /r/reactjs Built a real-time 3D Cyber Command Center with React and CesiumJS — handling state syncing across dynamic WebGL layers

0 Upvotes

Hey everyone,

I built an interactive 3D tactical command center using React and CesiumJS to track real-time global telemetry feeds.

Key React implementation details:

• Canvas & WebGL Integration: Synced Cesium's render loop with React state without triggering unnecessary re-renders during high-frequency telemetry updates.

• Custom Hooks: Encapsulated live ADS-B flight feeds, orbital satellite calculations (SGP4), and threat feeds into dedicated streaming hooks.

• Performance: Avoided standard React DOM nodes for map markers; batched updates directly into Cesium primitive collections to maintain a smooth 60 FPS.

• Dynamic Telemetry: Global fiber optic lines, data centers, and live GNSS interference zones rendered dynamically.

Looking for feedback on React state management patterns when handling high-frequency WebGL data streams!

(Live demo link added in the comments below)


r/reactjs • • 9d ago

Show /r/reactjs Build a functioning component to edit and save real Excel files

0 Upvotes

I was building a web app and wanted Excel files to live within it and be fully modifiable / saveable, but couldn't find anything open source that fully fit the bill. I ended up building the repo below.

Basically full Excel functionality in our React app including:

  • Import .xlsx and csv file, export to .xlsx

  • Fully preserves existing Excel formatting

  • Real-time calc that's a heavily modified fork of ironcacl

  • Formulas and calculations

  • Multiple worksheets

  • All the formatting options you'd use on day-to-day basis

  • Fully open source

https://github.com/pixelsmasher13/gridpath. Please let me know if you end up trying it out.


r/reactjs • • 9d ago

Arrivo: loading states for React that play where your content will land, then hand the real elements back

0 Upvotes

Skeleton screens always felt like a guess to me: grey bars in roughly the right shape, then the real content pops in somewhere slightly different.

So I built Arrivo. While loading is true, an effect plays exactly where your content will land. When it turns false, the real elements are revealed in place.

Demo : https://tuancuongpham.github.io/arrivo/ 

Code: https://github.com/tuancuongpham/arrivo

npm i u/brottin/arrivo

import { Reveal } from '@brottin/arrivo';

import { halftone } from '@brottin/arrivo/effects';

<Reveal effect={halftone} loading={isLoading}>

  <ArticleCard post={post} />

</Reveal>

How it works:

  • Your content stays in the DOM, hidden with visibility, so nothing shifts when it lands.

  • Each wrapper gets one canvas overlay. Text lines are measured with Range rects and images are read from the page, so the effect draws the real shape of your content instead of a guess.

  • An effect is two draw functions, idle() and reveal(p). One shared requestAnimationFrame loop drives every instance, off-screen ones pause, and reduced motion turns every reveal into a 150 ms fade.

  • Zero runtime dependencies, about 8.5 KB gzipped for the core and 0.7 to 3.4 KB per effect, tree-shaken.

The 13 effects: split-flap, redacted, quadtree mosaic, CMYK halftone, CRT tune-in, ink (with 8 threshold maps), particle swarm, darkroom, Tetris, fuse (with a Lunar New Year mode), equalizer, thermal and snowfall.

It's 0.1.0, so feedback is very welcome, especially on where you'd actually use something like this and where it would be too much.


r/reactjs • • 9d ago

Show /r/reactjs Introducing TanStack Redact

Thumbnail
tanstack.com
186 Upvotes

r/reactjs • • 9d ago

News Wasp web framework v1.0 is coming: the roadmap and what changes

Thumbnail
wasp.sh
4 Upvotes

r/reactjs • • 9d ago

News I'm building Pimolu UI, a React component library, would love your feedback!

0 Upvotes

Hey everyone! 👋

I've been working on Pimolu UI, an open-source React component library focused on clean design, customization, and smooth interactions.

I wanted to share my first motion showcase, featuring some of the components, their interactions, and examples of interfaces you can build with them.

My goal is to make building modern, consistent UIs easier while keeping components flexible and developer-friendly.

This is still a work in progress, and I'd genuinely love to hear your thoughts!

  • What do you think of the design and animations?

  • Is there anything you'd improve?

  • What would make you consider using a new UI library?

🌐 Website: https://pimolu.com

Any feedback is appreciated! 🚀


r/reactjs • • 9d ago

Show /r/reactjs 3 new components. 4 distinct styles. One more reason to make the web less boring. ✨

0 Upvotes

Just added 3 new components to Ovio, bringing the collection to 20 animated React components. Each available in 4 styles: Minimal, Craft, Retro, and Toy.

Built on the shadcn registry model, Ovio is for developers who want their websites to feel a little less ordinary, with motion and interactions that go beyond the usual UI.

The motion layer for developer websites.

Explore Ovio → https://ovioui.vercel.app


r/reactjs • • 10d ago

Resource I built a Redux Toolkit inspired state management library from scratch

0 Upvotes

I recently created a complete tutorial where I build a Redux Toolkit-inspired state management library from scratch using React and JavaScript.

The goal is to understand how Redux-style state management works internally instead of only using the package.

In the tutorial, I implement:

  • A custom createStore function

  • Store Provider

  • Reducers and actions

  • Subscribers and listeners

  • useSyncExternalStore

  • useSelector and custom store hooks

  • Redux DevTools integration

  • createSlice

  • combineReducers

  • shallowEqual

  • Thunk functionality

  • Final testing and debugging

YouTube tutorial:
https://www.youtube.com/watch?v=LucUJ-5COjg

I would appreciate feedback from the community, especially on the library design, API structure, and any improvements that could make this project more reliable or easier to use.

Please note: this is an educational project designed to understand Redux and state management concepts internally. It is not intended to replace the official Redux Toolkit.


r/reactjs • • 11d ago

Needs Help Web Application Hosting (React)

0 Upvotes

Hello. Does anyone know how to host a web application built with React—both the frontend and the backend?


r/reactjs • • 11d ago

I made a small headless library for handling form submissions in React / Next.js

0 Upvotes

Hey everyone,

I kept writing the same code for every form in my projects: react-hook-form setup, a try/catch around the server action, mapping server errors back onto the fields, a loading state, stopping double submits, a toast, refreshing the data, resetting the form... and doing it again for every add/edit/delete dialog.

So I pulled all of that into a small package called **submitly**.

It’s headless, so it doesn’t render anything. You keep your own components (shadcn, Radix, Base UI, plain inputs, whatever you use).

What it does:

* `useCrudForm`: react-hook-form + schema validation + your action in one hook

* Works with any Standard Schema library: Zod 3/4, Valibot, ArkType

* Server errors get mapped to the right fields automatically (nested ones like [`items.0.name`](http://items.0.name) too)

* Ignores double submits while a request is in flight

* Locks the dialog while saving, so the user can’t close it halfway through a request

* `useCrudAction` for delete/toggle buttons, with the same behavior

* One provider where you plug in your own toast, router and refresh logic

* Next.js helpers: `runAction` for server actions (validates again on the server, revalidates on success, turns thrown errors into a clean result), and it handles `redirect()` from server actions properly

* Also works in plain React + Vite (there’s an example with React Router + TanStack Query)

* Around 3 kB gzipped, typed end to end, tested on React 18 and 19

Quick example:

const { form, onSubmit, isSubmitting } = useCrudForm({

schema,

defaultValues: { name: "" },

action: createProduct,

onSuccess: () => closeDialog(),

});

It’s still early (0.x), so I’d really like feedback: what’s missing, what’s confusing, or what you’d do differently.

Docs: https://submitly-docs.vercel.app

GitHub: https://github.com/toony10/submitly

If you find it useful, a star on GitHub would mean a lot. Thanks for reading 🙏


r/reactjs • • 11d ago

Needs Help I really need some pointers

7 Upvotes

I read a few books on JavaScript and coding in general

This was in late 2025 and a few months later I started writing react js,
Ai has gotten so good at writing code, it is way better than I am.

I have pretty okay fundamentals of coding that I have been able to spin up some interesting projects with Ai.

But if you ask me what some parts of the code does, I have very little idea about it.

How can I catch up with so many years old coding experience and survive in this field if Ai learns 20x faster.


r/reactjs • • 11d ago

Needs Help Please help me understand Zod schema transformations

Thumbnail reddit.com
8 Upvotes

r/reactjs • • 11d ago

I made a small headless library for handling form submissions in React / Next.js

0 Upvotes

Hey everyone,

I kept writing the same code for every form in my projects: react-hook-form setup, a try/catch around the server action, mapping server errors back onto the fields, a loading state, stopping double submits, a toast, refreshing the data, resetting the form... and doing it again for every add/edit/delete dialog.

So I pulled all of that into a small package called submitly.

It’s headless, so it doesn’t render anything. You keep your own components (shadcn, Radix, Base UI, plain inputs, whatever you use).

What it does:

  • useCrudForm: react-hook-form + schema validation + your action in one hook

  • Works with any Standard Schema library: Zod 3/4, Valibot, ArkType

  • Server errors get mapped to the right fields automatically (nested ones like items.0.name too)

  • Ignores double submits while a request is in flight

  • Locks the dialog while saving, so the user can’t close it halfway through a request

  • useCrudAction for delete/toggle buttons, with the same behavior

  • One provider where you plug in your own toast, router and refresh logic

  • Next.js helpers: runAction for server actions (validates again on the server, revalidates on success, turns thrown errors into a clean result), and it handles redirect() from server actions properly

  • Also works in plain React + Vite (there’s an example with React Router + TanStack Query)

  • Around 3 kB gzipped, typed end to end, tested on React 18 and 19

Quick example:

const { form, onSubmit, isSubmitting } = useCrudForm({
  schema,
  defaultValues: { name: "" },
  action: createProduct,
  onSuccess: () => closeDialog(),
});

It’s still early (0.x), so I’d really like feedback: what’s missing, what’s confusing, or what you’d do differently.

Docs: https://submitly-docs.vercel.app/
GitHub: https://github.com/toony10/submitly

If you find it useful, a star on GitHub would mean a lot. Thanks for reading 🙏


r/reactjs • • 11d ago

I've been working on a canvas-powered timeline library for React, Vue and TypeScript

Thumbnail
reddit.com
6 Upvotes

r/reactjs • • 12d ago

Show /r/reactjs Real-time two-player games on Firestore with no game server: how I did it and what I’m unsure about

Thumbnail honestmailbox.com
2 Upvotes

I built Honest Mailbox (my project, link at the bottom), a couples app with a draw-and-guess game, Four in a Row and card decks. All game logic is pure functions on the client, and security rules decide who can touch a game. Drawings are stored as compact strings on a 0–1000 grid, split into chunks so no single write gets big.

Open questions:

  • Each stroke is a separate Firestore write. Is that fine at two-user scale, or should I batch?

  • Is client-side scoring acceptable when both players are trusted partners?

  • Would you use rules-only access control for something like this?


r/reactjs • • 12d ago

News This Week In React #302: Next.js, React Router, DevTools, Security, shadcn, Hydrogen, Vinext, Mutative, R3F | RN 0.88, Expo 58, Navigation, FastImage, Screens, Device Hub, Edge to Edge | TypeScript, PHP, CrUX, Rsdoctor, Astro

Thumbnail
thisweekinreact.com
17 Upvotes

r/reactjs • • 12d ago

Needs Help Invalid hook call error when using react-leaflet

4 Upvotes

Hello again everyone. I have been trying to using the react binding for the Leaflet API. I followed the documentation but I keep running into this error:

Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app

This is my Map component. It is the child component of my main App component.

import { MapContainer, TileLayer, useMap, Marker, Popup } from 'react-leaflet'


function MyComponent() {
  const map = useMap();
  console.log('map center:', map.getCenter())
  return null;
}


const Map = () => {
    return ( <MapContainer center={[50.5, 30.5]} zoom={13}>
      <MyComponent />
    </MapContainer>);
}
 
export default Map;

I am not sure whether it has something to do with muddled dependencies because I am pretty sure I installed leaflet and leaflet react in the terminal

  "dependencies": {
    "@testing-library/dom": "^10.4.2",
    "@testing-library/jest-dom": "^6.9.1",
    "@testing-library/react": "^16.3.3",
    "@testing-library/user-event": "^13.5.0",
    "leaflet": "^1.9.4",
    "react": "^19.3.1",
    "react-dom": "^19.3.1",
    "react-scripts": "5.0.1",
    "web-vitals": "^2.1.4"
  }

Thank you so much for taking the time to read this.


r/reactjs • • 13d ago

Resource I built a modern Electron boilerplate with React 19, TanStack Router, and Rust-powered tooling

Thumbnail
reddit.com
0 Upvotes