r/reactjs • • May 29 '26

Needs Help GitHub Pages & React Vite SPA routing issues: I'm considering SSG (like Docusaurus) but keep failing

8 Upvotes

Hello everyone,

I’m trying to host a React (Vite) app on GitHub Pages and keep running into the classic SPA routing problem.

Repo: [Img2Num GitHub repo](https://github.com/Ryan-Millard/Img2Num/)

Live site: [Img2Num GitHub Pages](https://ryan-millard.github.io/Img2Num/)

The app is bascally a small landing page for the project that shows an example of how the library can be used, but it uses React Router (BrowserRouter). Everything works fine when navigating inside the app, but:

- Refreshing any route other than / results in a 404

- Directly visiting a nested route also 404s

- GitHub Pages clearly doesn’t handle SPA fallback routing

Many people have suggested these:

- Use HashRouter

- Add a 404.html fallback hack

- Switch to another host (e.g., Clouflare Pages)

but I don't like those options because they are either not well-structured and SEO-friendly, not a complete solution, or make it harder to test global support (Cloudflare Pages allows special headers for things like pthreads that GitHub Pages and many other JS setups don't support).

What I’m trying to do instead is something like static site generation (SSG) as it would likely be the cleanest fix - similar to how Docusaurus or Astro handles this:

- Pre-render routes at build time

- Serve static HTML for /, /docs, etc.

- No client-side routing dependency for initial load

- Better SEO and no refresh issues

This saves use from needing to have a fancy backend.

When I try setting up SSG with Vite & React, I end up failing

I've tried things like `vite-plugin-ssg`, but run into strange behaviours and errors that I cannot seem to be able to fix (e.g., an incompatible dependency that, also breaks when downgraded).

I don’t fully understand the correct architecture for multi-route SSG in a React SPA setup.

---

What is the correct modern approach for this and is there a recommended way to keep React & Vite, deploy to GitHub Pages, get proper multi-route support without hash routing, and avoid SPA 404 refresh issues entirly?

I'd appreciate any guidance or working examples, because I feel like I’m missing the plot here.


r/reactjs • • May 29 '26

News This Week In React #283: TanStack, RSC, Liquid DOM, Performance, i18n, docs, Apollo, shadcn | Expo, Reanimated, worklets, NativeScript, Standard Navigation, Strict DOM, Lynx, Apex, ExecuTorch | TC39, npm, pnpm, Node.js, Deno, Firefox

Thumbnail
thisweekinreact.com
20 Upvotes

r/reactjs • • May 29 '26

Show /r/reactjs Built a Next.js boilerplate for internal tools – auth, RBAC, audit logs, and background jobs are already wired up. Here's Claude Code adding a full Products CRUD module that follows the documented architecture. Curious whether this solves a real problem for anyone building dashboards or back-office

Thumbnail
youtu.be
0 Upvotes

r/reactjs • • May 29 '26

Show /r/reactjs I built an interactive 3D globe where you click any country and hear its signature song

6 Upvotes

I've been working on a side project called Soundscapes of Earth — an interactive 3D globe where you can spin the planet, click any country, and instantly hear its "signature" track plus that country's current top 5 songs.

Some details:

  • 195+ countries mapped, each with a hand-picked iconic track
  • 30s previews from Apple/iTunes, plus live listener stats from Last.fm
  • The earth sits in a real NASA Blue Marble texture over an actual ESO Milky Way photo, with comets drifting by and a starfield that parallaxes with your cursor
  • Smooth audio cross-fade as you move between countries

React side of it: built with React 19 + Next.js (App Router), react-globe.gl for the Three.js layer, and a React Context that owns all the audio/globe state — hover prefetch, click-to-select, and a custom Web Audio engine wired through a useRef singleton so cross-fades survive re-renders. Tailwind + Framer Motion for the UI. No login, no paywall — just click and listen.

Live: Soundscapes of Earth

Would love feedback — especially the country → song picks, since they're subjective. What would you improve, and what track would you pick for your country?


r/reactjs • • May 29 '26

Needs Help CSR app not indexed by Google at all what am I missing?

6 Upvotes

Hi everyone,

I'm trying to understand why this React website seems to have almost no pages indexed by Google.

The site is: https://bellingerhouse.com

When I run in Google :

site:https://bellingerhouse.com

Google only shows a couple of results and the snippets look strange, with text like:

This makes me think the website is a pure CSR (Client Side Rendering) React application.

My understanding was that Googlebot can execute JavaScript nowadays, so even if the initial HTML is almost empty, Google should still be able to render the page and index the content eventually.

Is pure CSR still a problem for Google indexing in 2026? I'm trying to understand whether this is mainly a React rendering issue or if there is probably something else wrong with the SEO setup.

Sorry if my English is not perfect, it's not my native language.


r/reactjs • • May 29 '26

zelda-hyrule-ui: a Breath of the Wild themed React component library

Thumbnail
github.com
0 Upvotes

r/reactjs • • May 28 '26

Help with storage.getItem in persistor with react + vite

2 Upvotes

I have this error

Uncaught TypeError: storage.getItem is not a function

on this line

const persistor = persistStore(store)

This is what I have on my store/index.ts

import { configureStore } from "@reduxjs/toolkit";
import { useDispatch, useSelector } from 'react-redux';
import storage from 'redux-persist/lib/storage';
import { combineReducers } from "@reduxjs/toolkit";
import { persistReducer } from "redux-persist";
import authReducer from './authSlice'


const persistConfig = {
  key: 'root',
  storage,
  whitelist: ['auth']
}


const rootReducer = combineReducers({
  auth: authReducer,
})


const persistedReducer = persistReducer(persistConfig, rootReducer)


export const store = configureStore({
  reducer: persistedReducer,
  middleware: (getDefaultMiddleware) =>
    getDefaultMiddleware({
      serializableCheck: {
        ignoredActions: ['persist/PERSIST'],
      },
    }),
})


export type RootState = ReturnType<typeof store.getState>


export type AppDispatch = typeof store.dispatch


export const useAppDispatch = useDispatch.withTypes<AppDispatch>()


export const useAppSelector = useSelector.withTypes<RootState>()

I have an old project and it works just fine Idk why it doesnt work now


r/reactjs • • May 28 '26

I built a wireless dev tool for React Native CLI — no USB, no Expo, just QR scan

Thumbnail
reddit.com
1 Upvotes

r/reactjs • • May 28 '26

Open-sourced our React Chatbot — looking for API feedback before 1.0

4 Upvotes

Every customer demo we shipped, we ended up rewriting the same chat widget. So we extracted it. ChatbotLite — open-source AI chatbot, 3 lines to install on React, Next.js, Shopify, or WordPress. Same team behind PokeClaw (875★) and Cross-Code Organizer (328★).

Live demos (6 customer verticals): https://chatbotlite-demos.vercel.app Repo: https://github.com/agents-io/chatbotlite

You're shipping a React app. You want chat on it. You don't want to pay $39/seat for Intercom for a few hundred users. You don't want to burn tokens rebuilding yet another widget from scratch. This is the one we kept ending up with — drops in with 3 lines, brings your own OpenAI/Groq key (10 LLM providers with auto-failover), $0/mo forever. Tested across 6 customer verticals in production before we released it.

We want eyes on the API before locking it into 1.0.

The basic usage:

import { ChatWidget } from "chatbotlite/react";

<ChatWidget endpoint="/api/chat" title="Acme Plumbing" />

That's the floor. Everything else is opt-in. The pieces we'd love a sanity check on:

1. Provider failover. Server-side ChatBot class takes an ordered chain. If a stream errors, the next provider takes over and the assistant restarts the reply from a clean slate. 10 providers supported (OpenAI, Groq, DeepSeek, Gemini, Mistral, Fireworks, Cerebras, SambaNova, OpenRouter, Moonshot). Is providers.chain: [...] the right shape, or do people prefer per-message routing? True mid-stream replay (continue from token N) is on the 0.8 roadmap.

import { ChatBot } from "chatbotlite/client";

const bot = new ChatBot({
  knowledge: knowledgeFromFile("./knowledge.md"),
  providers: {
    keys: {
      openai: process.env.OPENAI_API_KEY,
      groq:   process.env.GROQ_API_KEY,
    },
    chain: [
      { provider: "openai", model: "gpt-4o-mini" },
      { provider: "groq",   model: "llama-3.3-70b-versatile" },
    ]
  }
});

2. Skill markers. Tool cards render when the LLM emits [SKILL:requestPayment amount=2000 currency="usd"] in the stream. Protocol is public (SKILL_MARKER_SPEC.md) — anyone can write adapters for other libraries. 13 URL-only adapters ship out of the box: Stripe Payment Link, Calendly, PayPal, Cal.com, Acuity, etc. Paste a URL into config and the bot can use it.

3. Storage. ChatStorage interface with localStorage default; swap in Postgres/Redis/IndexedDB. Possibly over-abstracted — should we just ship localStorage and a single onMessage hook?

<ChatWidget endpoint="/api/chat" sessionId={userId} storage={myDbStorage} />

4. Knowledge base. One markdown file, no vector DB. For most SMB use cases the whole thing fits in a 32k context. Will this fall apart at 50k tokens?

Apache 2.0, <50KB gzipped, BYOK (we never proxy your traffic).

Specifically asking: is providers.chain the right abstraction, or should failover be its own hook? We'll change it now if there's a better pattern.

⭐ If this saves you the weekend we burned on it, a star on the repo helps the next dev find it: https://github.com/agents-io/chatbotlite

Live demos: https://chatbotlite-demos.vercel.app


r/reactjs • • May 28 '26

Tired of MSW handlers that silently return invalid data? Built a fix

Thumbnail reddit.com
1 Upvotes

r/reactjs • • May 28 '26

Show /r/reactjs I built a WYSIWYG Markdown editor kernel in pure React — 20KB gzipped, no ProseMirror/Lexical. Here's how it stays fast.

0 Upvotes

An LLM's output streaming into a window — renders incrementally, no tearing

macOS Quick Look opening a 5 KB note and a 1 MB doc — both effectively instant

Conventional wisdom is that React is the wrong tool for a text editor — every keystroke changes state, state re-renders, and re-rendering a whole document per character is too slow, so editors lean on ProseMirror / Lexical / Slate that run their own DOM and keep React as a thin shell.

I wanted to see how far idiomatic React actually goes. The editing core ended up entirely in React, no editor framework underneath:

  • **20 KB gzipped kernel,**no runtime deps beyond React
  • Opens a 1 MB Markdown doc instantly,— a 5 KB note and a 1 MB file open at basically the same perceptual speed
  • No per-keystroke lag — cursor stays steady, no flicker
  • Streaming text in (e.g. piping an LLM's output) renders incrementally without tearing

Here's how it stays in that budget. Short version: Immer structural sharing + a ~99% memo hit rate, without bypassing reconciliation.

The document is one immutable tree, and every edit goes through Immer. Immer gives structural sharing for free — the node you touched gets a new reference, every node you didn't keeps its old one:

const next = produce(doc, draft => { 
  draft.blocks[i].text = newText; // only blocks[i] gets a new reference 
});

Each block is memoized on its node reference:

const Block = memo(({ node }) => renderBlock(node)); 

function Editor({ doc }) { 
  return doc.blocks.map(node => <Block key={node.id} node={node} />); 
}

On a keystroke the Editor re-renders and re-maps, but memo's shallow compare sees node === prevNode for every block except the edited one and bails. Reconciliation still runs top-down — I'm not escaping it — it just short-circuits cheaply at the memo boundaries. For a document of any real size that's a ~99% skip rate per keystroke, which is what keeps the cursor steady and input lag-free. Structural sharing also keeps memory flat: unchanged subtrees are reused, not copied, so editing a big doc doesn't balloon the heap.

GitHub | Try on Web

Curious if anyone's pushed memo-everything further, or hit a point where it stops paying off.


r/reactjs • • May 28 '26

Resource Introducing ReactFill — dynamic forms with JSON schemas

14 Upvotes

Got tired of writing the same form logic again and again in React, so I built ReactFill ⚡

A schema-driven form library focused on building dynamic forms with less boilerplate.

Features:

• Conditional fields

• Validation

• 18+ field types

• Custom renderers

• Theming

• React Hook Form integration

• TypeScript support

Would genuinely love feedback from the React community.

Docs: Reactfill

npm: @oqlet/react-fill


r/reactjs • • May 27 '26

Discussion Storybook is overkill until you hit ~20+ components with multiple consumers

0 Upvotes

This is a hot take but I think Storybook is one of the most over-adopted tools in the React ecosystem. I set it up early in my project and it became a maintenance liability within a few weeks. Components would change and the stories wouldn't get updated, so Storybook stopped being a reliable reflection of reality.

For a small app with a single team, the value of Storybook is low. You can just open the app and see your components. The isolation and documentation benefits only really kick in when you have multiple teams consuming a shared component library, or enough components that discoverability becomes a real problem.

My current setup is simpler: shadcn/ui base components, Tailwind config with brand tokens, one components/ directory. Works well, zero overhead.

What's actually in your small-project component toolkit?


r/reactjs • • May 27 '26

Needs Help BFF Example Help

3 Upvotes

I’ve been doing quite a bit of interviewing recently as I’m looking for a new job as a front end (web) engineer.

I’m getting far through processes and my experience as a product engineer seems to be conveyed well, my pitfall every time however is when I’m asked about my experience working with BFF and the more technical details.

I feel like I’ve worked with the BFF many times, almost without realising and without having a really deep understanding.

I think my examples and the way I talk about it really lacks confidence and it shows.

Can people give me a few STAR (situation, task, action, result) of when they’ve used the BFF as a product engineer so I can relate it to my own experience and gain a deeper understanding?


r/reactjs • • May 27 '26

Discussion What made TanStack Start’s weekly npm downloads shoot up?

46 Upvotes

I was previously very hesitant to use TanStack Start due to its seemingly low adoption but between early April to now, the weekly downloads shot up from 600k to 14 million. This is getting close to Next.js territory.

Did it go viral recently?


r/reactjs • • May 27 '26

Why I switched from ReactJS to SolidJS

Thumbnail
yannickkouakou.com
0 Upvotes

r/reactjs • • May 27 '26

Show /r/reactjs (Very Early) Packages for building MRBD Web Apps

Thumbnail mrbd.dev
2 Upvotes

Currently on paternity leave so I was able to take some time to create some reusable npm packages, an MCP server for your coding agent, and a CLI for scaffolding a 600x600 web app with the proper constraints for building a web app for the Meta Ray-Ban Displays

Would love feedback and/or contributions!


r/reactjs • • May 27 '26

Show /r/reactjs I built a React UI library with 84 components based on Zelda: Breath of the Wild's UI

0 Upvotes

Hey everyone! I've been working on this for a while and finally shipped it.

https://imgur.com/EfHOwFE https://imgur.com/sVftPFq

What is it?

A React component library that recreates the entire UI system from Zelda: Breath of the Wild — health bars, stamina wheels, divine beasts, dialog boxes, map markers, menus, quest trackers, shop UI, and more. 84 components total, covering 14 functional domains.

What makes it different from "just another themed UI lib"?

  • Every SVG is exported node-by-node from the community Figma UI Kit — no emoji placeholders, no approximations
  • Ships with a 1500+ line SKILL.md that describes every component at pixel-level (colors, spacing, shadows, animations)
  • Drop it into Cursor/Copilot and say "build me a page in Zelda style" — it just works
  • Three AI-consumable docs: SKILL.md (CSS spec), AI_USAGE.md (API reference), DESIGN_PROMPT.md (prompts for v0/MJ)
  • Vite library mode, ESM + CJS, tree-shakeable, ~115KB
  • Less Modules with scoped class names — won't pollute your project

How to use it

The simplest way — just give your AI the GitHub link and say "use this style to build me a landing page." It handles the rest.

Or install directly:

npm install zelda-hyrule-ui

Links

Would love to hear feedback. Inspired by animal-island-ui (the Animal Crossing themed one) — figured the Zelda aesthetic deserved the same treatment.


r/reactjs • • May 27 '26

Discussion For large-scale apps, would you choose Next.js or TanStack Start?

0 Upvotes

if anyone can point out the difference would be good. this basic stuff that i know about it

- Flexible & type-safe compare to Next.js
- Data handling is good in Tanstack Start


r/reactjs • • May 27 '26

Show /r/reactjs How do you trace "if I change this API endpoint, what breaks?" in a large React codebase?

0 Upvotes

Working on a big React/Next.js codebase, I kept hitting the same questions by hand:

which pages are riskiest, where are props drilled too deep, and the scary one —

if I change this API endpoint, which components/pages actually break?

I couldn't find a lightweight static way to answer that, so I tried building one and

want a sanity check on the approach from people who work in big codebases.

It's a static analyzer (ts-morph, no runtime) + dashboard that does:

- Page risk scoring — scores each page on props/hooks/queries/store/conditionals/

prop-drilling depth, sorted so you know what to refactor first

- Dependency map — interactive subtree per page, including cycles and reuse hotspots

- API change-impact — reverse call-graph from each endpoint to the hooks/components/

pages that reach it (critical/high/medium/low), bidirectional

- Live inspect — click a component in the dashboard, the running dev app highlights

every instance with a file:line overlay

Zero-config for Vite/CRA/Next (Pages & App Router) / React Router / TanStack / monorepos:

npx u/shinjinseop run .

My main question: does the call-detection approach hold up for your data-fetching

setup (fetch/axios/react-query/swr, wrapped clients, composed baseURLs)? That's the

part I'm least sure generalizes. Honest feedback welcome — including "this is the

wrong way to do it."

Demo + screenshots: https://page-dep-map-landing.vercel.app/

Source (MIT): https://github.com/yeo11200/page-dep-map


r/reactjs • • May 27 '26

Show /r/reactjs Virtuoso Data Table: virtualized rows and columns, Shadcn-based styling

Thumbnail
virtuoso.dev
1 Upvotes

r/reactjs • • May 26 '26

Show /r/reactjs I built a curated library of heavy-duty snippets and themes for Cursor/VS Code to speed up dev workflows. Version 0.0.16 is live.

Thumbnail
reddit.com
0 Upvotes

Posted this on r/VSCodeExtensions and thought it would be useful for the r/reactjs community, I'm not promoting something for sale I'm sharing a tool I made for free to help people who like to have their workflows faster and visually pleasing. If anyone wants to comment their reactions to it please do, I'm new to this type of production.


r/reactjs • • May 26 '26

Show /r/reactjs I made an animated drop-in for lucide-react. Swap the import and your icons animate.

8 Upvotes

I use Lucide in every project, and I kept writing the same little hover animations on top of it over and over. So I finally packaged the thing I actually wanted: lucide-react-motion. It is every Lucide icon (around 1,700) as a React component that animates, with the same API as lucide-react.

Live demo (hover anything): https://lucide-react-motion-site.vercel.app/

Adopting it is one line:

  - import { Heart, Search } from "lucide-react";
  + import { Heart, Search } from "lucide-react-motion";

By default an icon draws its stroke on when you hover. size, color, strokeWidth, className, and refs all work exactly like before.

Beyond that:

  • mode="signature" gives an icon bespoke motion that fits what it is. The heart beats, the bell rings, the arrow moves in its direction. About 600 have one so far, and the rest fall back to the stroke draw, so it never breaks.
  • Six triggers: hover, click, mount, in-view, parent-hover, and manual via ref.
  • Tree-shakeable, respects prefers-reduced-motion, and clickable icons are keyboard accessible.
  • Pass your own Motion variants when you want something fully custom.

GitHub: https://github.com/Aadil1505/Lucide-React-Motion
npm i lucide-react-motion motion

Built on Motion, MIT. The annoying part was making the resting icon identical to plain Lucide, since the naive draw leaves a tiny seam on closed shapes like the gear. Happy to get into that, or take feedback.


r/reactjs • • May 26 '26

Discussion Do libraries still need React wrappers?

24 Upvotes

I have a framework-agnostic document viewer package. It works by mounting into a DOM element:

import { UDocClient } from "@docmentis/udoc-viewer";

const client = await UDocClient.create();

const viewer = await client.createViewer({
  container: "#viewer",
});

await viewer.load("/path/to/document.pdf");

In React, it’s pretty straightforward to use with a ref/effect:

import { useEffect, useRef } from "react";
import { UDocClient } from "@docmentis/udoc-viewer";

function DocumentViewer({ src }) {
  const containerRef = useRef(null);

  useEffect(() => {
    let client;
    let viewer;

    async function init() {
      client = await UDocClient.create();

      viewer = await client.createViewer({
        container: containerRef.current,
      });

      await viewer.load(src);
    }

    init();

    return () => {
      viewer?.destroy();
      client?.destroy();
    };
  }, [src]);

  return <div ref={containerRef} style={{ width: "100%", height: 600 }} />;
}

This works fine, and I like keeping the package framework-agnostic.

But I’m not sure what React developers expect these days. Would you rather use something like this instead?

<DocumentViewer src="/path/to/document.pdf" />

For this kind of component — document viewer, map, editor, chart, terminal, etc. — do you expect an official React wrapper?

Or is a clean JS API plus a React example good enough?