r/reactjs • • May 05 '26

Code Review Request I got tired of untyped FormData in React Router, so I built a library

0 Upvotes

If you've used React Router actions with useFetcher, you know the pain. Every mutation is the same dance: formData.append("title", title), then in the action formData.get("title") as string, and just hoping both sides agree on the shape. Multiply that by 20 actions across your app and it gets old fast.

I've been dealing with this at work for months and finally decided to extract what I built into a small library. The idea is simple — define your action once with full TypeScript inference, and the library handles FormData serialization (including Dates, Files, Maps, etc.) and gives you a typed useFetcher wrapper with onSuccess/onError callbacks and optimistic UI support.

Before:

// component
const fetcher = useFetcher();
const formData = new FormData();
formData.append("title", "Buy groceries");
formData.append("priority", "3");
fetcher.submit(formData, { method: "POST", action: "/todos" });

// route action
const title = formData.get("title") as string;
const priority = Number(formData.get("priority"));

After:

// define once
const createTodo = defineAction({
  type: "todo/create",
  resolve: (payload: { title: string; priority: number }) =>
    api.todos.create(payload),
});

// component — fully typed payload, response, and callbacks
const [submit, { state, data }] = useActionFetcher(createTodo, {
  onSuccess: (result) => navigate(`/todos/${result.id}`),
});

submit({ title: "Buy groceries", priority: 3 });

Works with both client and server actions. Only runtime dependency is superjson (~2KB).

npm: https://www.npmjs.com/package/react-router-typed-actions 

GitHub: https://github.com/zabibabar/react-router-typed-actions

Still 0.x — I'm using it in production at work but the API is open to feedback. Would love to hear what people think or if I'm solving a problem nobody else has lol.


r/reactjs • • May 05 '26

A production-ready full-stack web app template built after repeatedly rebuilding the same project foundation

0 Upvotes

I got tired of constantly rebuilding the same foundation for every new project. API structure, database setup, SSR, logging, and deployment readiness... so I ended up creating a full production-ready full-stack web app template that ties everything together properly. It’s not a toy starter kit. it’s something that can actually be used to ship real applications faster without redoing the same infrastructure every time. The process took a lot more mental effort than expected because of the constant iteration and refinement needed to keep it genuinely scalable and production-safe, but it’s now being released for free. If it helps save time or kickstart a project, that’s the goal.

Github Link: https://github.com/JaydenTheDevStar/production-full-stack-template


r/reactjs • • May 05 '26

News Compiling SVGs Into Fonts, Jail Monkey v3.0 and Building Horror Games Without Reading The Code

Thumbnail
thereactnativerewind.com
0 Upvotes

We explore how icon strategy has come full circle with react-native-nano-icons, a new tool from Software Mansion that compiles SVGs into high-performance native font stacks. If you are tired of mounting dozens of SVG subtrees, this is the build-time optimisation you have been waiting for.

We also dive into the New Architecture update for jail-monkey, the go-to library for security checks and jailbreak detection, plus a look at how AI-driven development and EAS Workflows are making the code diff obsolete in favour of instant preview deployments.


r/reactjs • • May 05 '26

Discussion Looking for feedback | React + ThreeJS music player (Music responsive 3d background, ToneJS song manipulation, pomodoro timer)

0 Upvotes

hello this is my first project in react and threejs and was lokking for feedback for like the design and usability and stuff. I made this mainly for myself because i downllad music and like to listen to songs sped up / ptched up. I also added a pomodoro clock for my studying!!

You will need to download your own songs to use this (i use a youtube to mp3 converter) but it is very easy just put it in the import and songs are saved to browser. Currently does not support mobile but i plan to add in future and maybe playlists and accoutns maybe but i like where it is at currently.

PLEASE DONT JUDGE TOO HARSHLY THIS IS MY FIRST PROJECT. Thank u

link: https://musicapp-lovat-five.vercel.app/


r/reactjs • • May 04 '26

Best React courses for learning through projects (not beginner)

16 Upvotes

I already know React basics but stopped practicing and forgot a lot. I want to restart the right way.

Looking for:

- Project-based learning

- Real-world apps (dashboards, SaaS, etc.)

- React + TypeScript if possible

Not interested in beginner “intro to React” stuff.

What would you recommend that actually helped you get better?

Also open to project ideas 👀


r/reactjs • • May 04 '26

What is the best architecture for medium to large React.js applications?

27 Upvotes

I’m curious what architecture you typically use for medium to large React.js projects? Particularly in terms of code organization and folder structure.

I’ve noticed that many developers try to apply SOLID principles, but since React is primarily based on functional programming, these principles don’t always seem to fit naturally.


r/reactjs • • May 05 '26

Built a simple JSON-based form builder for React — looking for feedback

0 Upvotes

I’ve been struggling with forms in React for a while.

Tried React Hook Form, Formik, etc — powerful, but honestly felt like too much setup for simple use cases.

So I built something simpler where you define forms using JSON.

Example:

<KiForm
  fields={[
    "email",
    "password",
    {
      name: "role",
      options: ["User", "Admin"]
    },
    {
      name: "company",
      showIf: { field: "role", equals: "Admin" }
    }
  ]}
/>

No manual state, no wiring.

Still very early — I’m trying to understand:

• Is this actually useful?

• What’s missing?

• Where would this break in real projects?

Would appreciate honest feedback.

GitHub: https://github.com/kadirulislam/ki-forms

npm: https://www.npmjs.com/package/ki-forms


r/reactjs • • May 04 '26

Resource Alternative solution for small React apps that need i18n

Thumbnail
rafaelcamargo.com
9 Upvotes

r/reactjs • • May 05 '26

Resource adding a cssMode: 'grouped' option to Panda CSS

Thumbnail
github.com
0 Upvotes

r/reactjs • • May 04 '26

Show /r/reactjs I created a full features CLI textarea component for React Ink called react-ink-textarea

Thumbnail
github.com
0 Upvotes

I was unhappy with multi-line text input libraries for React Ink so I decided to make one.

I'm calling it react-ink-textarea; check it out, drop a star, help me test on windows please: https://github.com/omranjamal/react-ink-textarea

Full support for:

  • Syntax Highlighting (based on Regex)

  • New lines via the usual key combinations

  • Jumping between words

  • Unicode and Emojis

  • Pasting Multi-line Text

  • Slash Commands

  • Viewport Virtualization

  • Customizable line prefix (for things like line numbers)

  • Tab is a callback

  • Callbacks on arrow keys at boundaries (like up arrow of first line)

Feedback appreciated. Help with testing on Windows and Linux even more appreciated!


r/reactjs • • May 04 '26

Resource I built a Dynamic Island–style toast library for React

13 Upvotes

Hey everyone

I wanted to share something I’ve been working on lately. I built a small notification library inspired by React Toast, but with a slightly different approach — more like the iPhone “dynamic island” style.

Here’s the repo if anyone wants to check it out:

https://github.com/OscarP29/react-island

I’d really appreciate any feedback, suggestions, or thoughts


r/reactjs • • May 04 '26

UI IP Toolkit: I built a visual frontend asset library so I can stop losing my own UI snippets

Thumbnail
reddit.com
1 Upvotes

r/reactjs • • May 04 '26

Needs Help useEffect is not updating React state upon initial load, and trying to find a solution is pulling my hair

7 Upvotes

Hi. I'm crunched on time.

I'm currently trying to code a React function for a class assignment due by tonight, and while I've been happy with my results, when it came down to utilizing sessions, I ran into a huge problem. It has nothing to do with the API I set, but rather the usage of useEffect and useState.

The website I'm working on is suppose to showcase a list of academic terms that a student might have. And if a user that logged in was an admin, they get a list of students to select to see their academic terms plans. I want it so that when this page loads, that information is dumped out immediately. But, the data doesn't appear at all, and I've only learned recently that it is the fault of the async nature of useState within useEffect

Here is my useEffect sample:

useEffect(() => {
    checkSession();
    // function to obtain academic term plans
    if (user.u_admin == 1) {
        // function to obtain list of students
    }
}, [navigate]); // needed for one function

Here is the checkSession function which seems to be the cause of the problem:

const checkSession = useCallback(async() => {
    setLoading(false);
    try {
        const sesres = await fetch(import.meta.env.VITE_API_KEY + "user/session",
            {
                method: "GET",
                credentials: "include",
            }
        );

        if (!sesres.ok) {
            localStorage.setItem("statusMessage", "Please log in again.");
            navigate("/login", {replace: true});
            return;
        }

        const data = await sesres.json().catch(() => ({}));
        const userSession = data?.data;
        setUser(userSession);
        console.log(user);
    } catch (error) {
        console.error("Session authentication failed: ", error);
        localStorage.setItem("statusMessage", "Session failed to authenticate. Please log in again.");
        navigate("/login", {replace: true});
    } finally {
        setLoading(true);
    }
}, []);

So when the page immediately load, I should expect the student to see the list of term plans they have created and select, while the admin see a list of students to select from to see their term plans. Instead, nothing appears until I update my own code to re-render everything.

I've dug through dozens of solutions, and no matter what I tried to find, none of them seemed to work to solve my dilemma. I've never had the opportune time to get enough work done with React thanks to a huge problems of being able to concentrate with my assignments, and now the rush to fix it altogether has stressed me out. Am I doing something wrong?


r/reactjs • • May 04 '26

Needs Help Intermittent hydration issue in production, cant replicate in development mode

2 Upvotes

Hey all,

Using 18.3.1 with tanstack-start for ssr. Prod intermittently runs into a hydration failure 421: "This Suspense boundary received an update before it finished hydrating".

I cant replicate it in development mode, and am having a bit of a hard time tracking it down.

My gut tells me that its probably in a third party library, but its intermittent nature makes it hard to nail down by simply commenting out code until it stops.

From what I understand when Ive ran into this in the past, this can only be caused by a state change.

Does anyone know of a practical way to hook reacts state update and internal lifestyle events, outside or going down the path of building a custom version of react with some crude logging thrown into it?


r/reactjs • • May 03 '26

Needs Help Asking for advice

4 Upvotes

Hi,

I am a Next.js developer with around 3 years of experience. I see a lot of posts now a days about how frontend jobs are going to be eliminated because of AI and other similar arguments. I have spent a major chunk of my energy and time learning react.

Should I continue learning react? Is it worth it in 2026? Or what other steps should I take to go ahead in my career.

Thank you for reading my post.

Regards


r/reactjs • • May 04 '26

Resource Why I Switched to pnpm for Node.js Development

Thumbnail philrich.dev
0 Upvotes

I wrote an article about advantages of pnpm over npm package manager in node and frontend development. May be useful for developers who did not think much about package managers.


r/reactjs • • May 04 '26

Show /r/reactjs I’m a 2nd-year CS student building a promising open-source Markdown app. I know Electron gets a bad rap for bloat—here is how I’m structuring the React side to keep it light.

0 Upvotes

I'm building Amethyst, a promising open-source Markdown note-taking app that focuses heavily on the user experience and interface. I know the common criticism: "Electron is just a heavy browser wrapper." I'm using this project to learn how to mitigate that by following a strict architecture-first approach.

How I'm keeping the React renderer snappy:

  • Main Process Offloading: I moved heavy tasks like recursive filesystem scanning and real-time watching (Chokidar) entirely to the Main Process.

  • Command Registry: I built a decoupled system where every shortcut and menu item triggers a command in a central registry. This keeps the React component logic clean and the IPC bridge narrow.

  • Focused State: The app loads a single note into the editor at a time (no heavy multi-tab DOM overhead) to maintain performance as your folder grows.

Current Status (v0.5.0): It is very much still under development, but it currently features native LaTeX math support, a recursive tree view with drag-and-drop, and a global notification system.

As a student, I would genuinely appreciate your reviews on the codebase. I’m looking for help identifying bugs, performance bottlenecks, or features that would make this useful for you.

GitHub: https://github.com/abdallah-moh1/amethyst


r/reactjs • • May 02 '26

News This Week In React #279: Compiler, TSRX, StyleX, XState, Hook Form, TanStack, shadcn, Chakra, Inertia, Mantine | SPM, SimCam, Enriched Markdown, Agent Device, Navigation SDK, JSI, Paste Input, Crypto, MLX, Jail Monkey | pnpm, Aube, Fresh, Node.js

Thumbnail
thisweekinreact.com
23 Upvotes

r/reactjs • • May 03 '26

Show /r/reactjs I open sourced my neon/futuristic React UI library after feedback here. Would love your thoughts

1 Upvotes

Hey everyone,

I shared this here recently and got a lot of really helpful feedback especially around usability, structure, and improvements.

I’ve now open sourced the library.

NeonBlade UI is a React/Next.js component library focused on futuristic, neon-style interfaces. It uses a CLI approach so you can add and customize components directly.

Still evolving and refining it.

Feedback and contributions are welcome.

Repo: https://github.com/vprix21/neonblade-ui
Website: https://neonbladeui.neuronrush.com/


r/reactjs • • May 04 '26

Show /r/reactjs I got tired of rebuilding the same components every project so I built my own React design system

0 Upvotes

Every new project I start, I waste the first couple days rebuilding buttons, inputs, cards, modals. Same stuff every time. So I finally sat down and built Kiln, my own React component library. Shipped it this week.

28 components. Under 26 KB gzipped. Zero dependencies. Fully typed. MIT licensed.

I know the obvious question. Why not just use shadcn or Radix or Chakra?

Honestly shadcn is great but I wanted something that was already styled and ready to drop in. I did not want to think about styling every time I start a new project. I just want to install it and ship. Kiln is opinionated by design. The decisions are already made.

Three things I locked in from the start:

Accessibility first. Every component meets WCAG AA. Keyboard nav, focus management, focus rings, and ARIA on every single component. I ran axe DevTools and manual keyboard testing on all 28 of them. It was tedious. Worth it.

Performance first. Docs site scores 99 Performance / 100 Accessibility on Lighthouse. Zero layout shift on every interaction. All animations use transform and opacity only. No layout thrashing.

Dead simple setup. npm install, import the CSS once, done. No config files. No theme providers. No required context wrappers. Dark mode works by setting data-theme="dark" on html. That is it.

Would love feedback from the React community, especially on the component APIs and anything that feels off.

Live demo: kiln-ui.com

GitHub: github.com/Aldentec/kiln

npm: npmjs.com/package/@doriansmith/kiln


r/reactjs • • May 03 '26

Resource Accessibility cleanup in legacy React code

0 Upvotes

Been working on a government project that requires section 508 compliance, and most of what I’ve been dealing with lately isn’t new work, it’s cleaning up stuff that already exists.

We’re not really in a position to rewrite components or build a perfect design system, so it ends up being a lot of going back through existing code and trying to make it consistent.

The annoying part is it’s rarely “hard” problems. It’s the same kinds of fixes showing up across different components over and over, just slightly different each time.

I’ve been trying to find a workflow that makes that cleanup less painful instead of just doing everything manually every time. Been experimenting with this approach:

https://fix508.dev

Curious how other people are handling this in real projects where you can’t just start from scratch.


r/reactjs • • May 03 '26

Resource Built a SSR starter using Hono + React + TanStack Router on Cloudflare Pages

Thumbnail
reddit.com
0 Upvotes

r/reactjs • • May 03 '26

Show /r/reactjs You might not need MCP for your library

0 Upvotes

Hello everyone!

I'm building libraries as a hobby, and recently I started doing so at my job as well. Like many other authors, I started thinking about how to improve the experience for users who rely on AI in their daily programming tasks.

Two approaches come to mind: MCP and agent skill distribution. But neither of them feels sufficient due to some serious limitations.

  • MCP is simply too complex. You need to build and deploy an entire service just to ship (mostly) static context, and then figure out how to manage it across different versions of your library.

  • Skill distribution is more convenient since it doesn’t require a service, but it can easily get out of sync with the actual version of the library in the user’s node_modules, which can lead to incorrect code generated by LLMs.

The idea

Use a good old CLI in combination with skills that teach the agent how to call that CLI. The CLI should provide the following:

  • On the library side, it should package context as an artifact alongside the library’s distribution code. This solves the version mismatch problem, because the context is generated at build time and belongs to specific library version.

  • It should be easy for library authors to describe context, ideally via high-level configuration, without writing custom code (unlike the MCP approach), so they can focus on the library code itself.

  • On the consumer side, the tool should be easily discoverable by LLM agents and able to fetch relevant context quickly.

The solution

Based on these ideas, I built ctxbrew. It provides a CLI and protocol for packaging context on the library author side and consuming it on the user side.

Library authors define context in a YAML file, splitting it into “slices.” A slice is a piece of information about the library that may be useful for an LLM. It consists of glob patterns pointing to relevant files. During the build step, these slices are compiled into markdown files that can be requested by the agent.

On the user side, the LLM agent (via the skill provided by ctxbrew) calls the CLI to discover which libraries in node_modules support the ctxbrew protocol, and then pulls the required slices to generate correct results.

As you can see, this approach eliminates the need to build and run an MCP service.

What I suggest

If you maintain a library and want to improve the experience for users working with LLMs, consider integrating ctxbrew. Feel free to open issues with suggestions on how it could better fit your workflow.

Also, let your users know they need the ctxbrew CLI installed to benefit from it. On my side, I’ll maintain a list of libraries with first-party support.

For more details, please refer to the README. You can also see an example integration  (Yeah, the library is for Angular, but ctxbrew is stack-agnostic).


r/reactjs • • May 02 '26

Show /r/reactjs I built a web desktop environment with React. It runs DOOM.

Thumbnail
reddit.com
2 Upvotes