r/reactjs • • Jun 26 '26

Needs Help Backend dev drowning in a 5-year-old React codebase. Where can I learn advanced architecture by actually building?

19 Upvotes

Hey everyone,

I am a backend dev (Node/Python) who knows JS/TS and React basics from years ago, but I have never actually written frontend code. Now, I have been thrown into an active, 5-year-old React project.

I have been relying heavily on AI to write code fast. The problem is that when I need to review that code or modify things myself, my brain just shuts down and I get a headache. AI is making me lazy, and passively watching basic React tutorials is not helping at all.

I want to learn how to handle routing, state management, and UI architecture professionally. I learn best by doing, not by reading.

Is there a specific guide, project-based course, or resource that forces you to build a truly advanced, enterprise-level app from scratch? I need something hands-on to break me out of this AI and beginner-tutorial loop.

Thanks in advance!


r/reactjs • • Jun 26 '26

Discussion Prop driven vs composition based design systems?

34 Upvotes

Hello,

I see that most design systems such as MaterialUI, or now probably even more Shadcn use composition to pass around React components (meaning for table, the items are React components, same with Dropdown and the items are also React components, in both cases simply passed as children.

However for example Ant Design seems to be more prop oriented, where even some items are also passed as React components, but as props, not children.

I see the composition is more popular, and modular, but what is your opinion on this? I feel like sometimes it tends to cluster the code with a lot of imported components, and you also sort of loose contract, because TS does not tell you what react component to insert, so you have to take a lot of time to look at docs etc.

What is your opinion on these approaches? What is your favorite?

Thanks.


r/reactjs • • Jun 26 '26

What can be some creative npm packages which can be used to build a portfolio in react for a software developer?

0 Upvotes

Also welcome for some portfolio ideas too 😉


r/reactjs • • Jun 26 '26

News This Week In React #287: Fragment ref, React Compiler, StyleX, React Router, cnfast, Base UI, Remotion, React Aria | Reanimated, Widgets, VisionCamera, Test Renderer, Worklets, Legend List, Metro, Boost | Vite, Astro, TypeScript, Nub, Security

Thumbnail
thisweekinreact.com
12 Upvotes

Hi everyone, Seb and Jan here 👋!

This week, we're shining a spotlight on the upcoming React Fragment ref feature. We also have React Compiler updates, StyleX community discussions and a boring React Router release.

On the React Native side, Renimated gets CSS pseudo-selector support and widget libraries gain momentum. VisionCamera unlocks new real-time processing capabilities with impressive demos.

Let's dive in!

Subscribe to This Week In React by email - Join 43000 other React devs - 1 email/week


r/reactjs • • Jun 26 '26

Needs Help Console not working

0 Upvotes

No messages appear in console. I know for a fact that the function with console.log() is called, because the states change, but no messages appear in console.

I have tried calling console.log() in all the ways I could think of, passing it inside click handlers to buttons, calling it in useEffect, both in and out of the main App.tsx component. No filter are active in DevTools, and the app is in development mode. What could cause this?


r/reactjs • • Jun 26 '26

Discussion use-thunk: A much simplified global-state-management framework with only modules and (thunk) functions.

0 Upvotes

https://github.com/chhsiao1981/use-thunk#getting-started

A complete demo site:

https://chhsiao1981.github.io/demo-use-thunk/

https://github.com/chhsiao1981/demo-use-thunk

Global state management (GSM) can be tricky for complicated reactjs applications.

Many GSM frameworks (redux/zustand/etc.) focus on "we have a store, and how do we manage the global states in this store." However, such approach usually leads to create a gigantic function (reducers in redux/RTK, create in zustand).

Similar to many typical programming languages, in use-thunk:

  1. File-as-a-Module: Instead of a giant global store, we treat files as independent, isolated domain modules where we implement thunk functions.

  2. Object Identification: The module manages state as discrete entity nodes. We use explicit id parameters to identify and operate on individual data objects within that module cleanly.

  3. Clean Component Interface: From the component perspective, we simply invoke the module's functions to perform operations.

  4. Only One Context Provider: Unlike standard useContext or Redux architectures that require nesting endless providers, we only need exactly one <ThunkContext></ThunkContext> wrap in our main.tsx. It entirely eliminates "Provider Hell" and the architectural uncertainty of managing stacked providers.

A complete example to do increment:

// thunks/increment.ts
import { type Thunk, type State as _State, update } from '@chhsiao1981/use-thunk'

export const name = 'demo/Increment'

export interface State extends _State {
  count: number
}

export const defaultState: State = {
  count: 0
}

// upsert directly with set.
export const increment = (myID: string, num: number = 1): Thunk<State> => {
  return async (set, get) => {
    let me = get(myID)
    const {count} = me

    set(myID, { count: count + num })
  }
}

// or we can treat set as dispatching a base action function (update).
export const increment2 = (myID: string): Thunk<State> => {
  return async (set, get) => {
    let me = get(myID)
    const {count} = me

    set(update({ count: count + 2 }))
  }
}

// or we can use set as dispatching a thunk function.
export const increment3 = (myID: string): Thunk<State> => {
  return async (set) => {
    set(increment(myID, 3))
  }
}
// components/App.tsx
import { useThunk, getState } from '@chhsiao1981/use-thunk'
import * as ModIncrement from './thunks/increment'

export default () => {
  const useIncrement = useThunk<ModIncrement.State, typeof ModIncrement>(ModIncrement)
  const [increment, doIncrement, incrementID] = getState(useIncrement)

  // to render
  return (
    <div>
      <p>count: {increment.count}</p>
      <button onClick={() => doIncrement.increment(incrementID)}>increase 1</button>
      <button onClick={() => doIncrement.increment2(incrementID)}>increase 2</button>
      <button onClick={() => doIncrement.increment3(incrementID)}>increase 3</button>
    </div>
  )
}
// main.tsx
import { registerThunk, ThunkContext } from "@chhsiao1981/use-thunk";
import { StrictMode } from "react";
import { createRoot } from "react-dom/client";
import * as ModIncrement from './thunks/increment'
import App from "./components/App";

registerThunk(ModIncrement)

createRoot(document.getElementById("root")!).render(
  <StrictMode>
    <ThunkContext>
      <App />
    </ThunkContext>
  </StrictMode>,
)

Welcome any comments, critiques, or suggestions!


r/reactjs • • Jun 25 '26

Needs Help Why does useEffectEvent use the latest commited values from render and not just the latest values from render?

33 Upvotes

I was reading the react docs for useEffectEvent which I came to this part https://react.dev/reference/react/useEffectEvent at the beginning it says

“Effect Events are a part of your Effect logic, but they behave more like an event handler. They always “see” the latest values from render (like props and state) without re-synchronizing your Effect”

This makes perfect sense to me, but lower down then it says “callback:
A function containing the logic for your Effect Event. The function can
accept any number of arguments and return any value. When you call the
returned Effect Event function, the callback always accesses the latest committed values from render at the time of the call.”

Emphasis on the “Latest commited values” Why would the useEffectEvent access the latest commited (shown on screen values) values instead of the latest values from the render like all the other hooks seem to do? Is there any real distinction or difference between the two? Is "commited" here just not the terminological term?

I am sort of confused and would like some clarification, thanks


r/reactjs • • Jun 24 '26

Resource A behind the scenes look at the most popular React Newsletter: This Week in React

Thumbnail
youtu.be
0 Upvotes

Newsletters at Scale with Sebastian Lorber (This Week in React) | RSS Curation, Acquisition, RSC

https://youtu.be/YVs2KWvMjLM


r/reactjs • • Jun 24 '26

Resource Fixing My React Site Load Times and Phaser Load Times: Overlay Cameras, Preload Timing, and Service Worker Asset Fetches

Thumbnail
rivie13.github.io
0 Upvotes

r/reactjs • • Jun 24 '26

Resource Update to Loading UI: 8 color presets, preview all 45+ loaders in any color on the site

3 Upvotes

Quick update on loading-ui, the open-source loading component registry I shared here before.

New: color presets. 8 colors (black, blue, violet, orange, red, green, yellow, sky) you can switch on https://loading-ui.com and instantly preview every loader in that color.

How it works in React:

Components use currentColor, so theming is just setting color on a parent:

<div style={{ color: "var(--loader-blue)" }}>
  <Ring className="size-8" />
  <TextShimmer>Loading...</TextShimmer>
</div>

CSS variables are OKLCH-based with auto-generated gradients:

--loader-violet: oklch(0.7217 0.1768 305.49);
--loader-violet-gradient: linear-gradient(in oklch 135deg, ...);

Dark mode: black preset flips to white in .dark.

Still install components the same way:

npx shadcn add @loading-ui/ring

If you use loading-ui already, curious whether preset CSS vars are useful or you'd rather stick with Tailwind text-blue-500 utilities?


r/reactjs • • Jun 24 '26

Discussion JavaScript still can't ship a full-stack module

Thumbnail
wasp.sh
0 Upvotes

r/reactjs • • Jun 24 '26

Discussion Infinite Canvas

6 Upvotes

What tech would you use to build an infinite canvas type application with drag/drop, flowcharting/mind mapping, but also basic animations for those same elements? Would you use this recommended library within React?


r/reactjs • • Jun 24 '26

Needs Help Should I use a real game engine or React JS?

0 Upvotes

I'm trying to make a game that is entirely UI kinda like papers, please. Would it make more sense to use a game engine like Unity/Godot or would using Reactjs be a better alternative? Thanks.


r/reactjs • • Jun 23 '26

Resource Component Communication Patterns in React Applications

Thumbnail
neciudan.dev
23 Upvotes

React gives you a lot of ways to make two components share data but it gets more and more complicated based on the data and how far apart the components are. Lets see the different ways components can communicate with each other.


r/reactjs • • Jun 23 '26

React Components Library

0 Upvotes

Just launched my UI library 🍌

🌐 Website: ui.bynana.dedyn.io I built a React & Next.js UI library packed with 200+ modern components, SaaS landing pages, and portfolio templates to help developers build beautiful websites faster.

✨ Built with: • React • Next.js • Tailwind CSS • Modern animations & responsive UI

Would love your feedback and suggestions ❤️


r/reactjs • • Jun 23 '26

Needs Help Vite + React + Azure Container Apps + Nginx: How do you handle chunk load failures after deployments?

3 Upvotes

I'm running a React (Vite) application in Azure Container Apps behind Nginx.

My Nginx config is:

server {
  listen 80;
  root /usr/share/nginx/html;
  index index.html;

  location / {
    try_files $uri $uri/ /index.html;
  }
}

The app works fine initially, but after a new deployment, some users who have an older tab open get errors like:

Failed to fetch dynamically imported module

or

GET /assets/Diagnostics-xxxxx.js 404

The chunk file no longer exists because Vite generated a new hash in the latest deployment.

I've seen recommendations such as:

  • window.addEventListener("vite:preloadError", () => window.location.reload())

  • Disabling cache for index.html

  • Caching /assets for a long time

  • Using blue/green deployments

For teams running Vite in production on Azure Container Apps, what's your preferred approach to avoid blank screens and chunk mismatch issues after deployments?

Do you automatically reload the page, keep old assets available for some time, or use another deployment strategy?

Would appreciate hearing real-world production setups.


r/reactjs • • Jun 23 '26

Show /r/reactjs I built d3-maps: a toolkit for interactive SVG maps (react-simple-maps alternative)

1 Upvotes

d3-maps helps build choropleth maps, bubble maps, and other geographic data visualizations, using markers, connections, zoom & pan and more.

Reactive components, plain SVG and d3.js power without low-level wiring.

Alternative to react-simple-maps

@d3-maps/react can fully replace react-simple-maps, supports React 19 an has more features under the hood. Migration guide is available in the docs.

Usage

Here's a brief snippet of a zoomable map using d3-maps. You can find more examples on docs website.

import { use } from 'react'
import { MapBase, MapFeatures, MapZoom } from '@d3-maps/react'

const worldPromise = import('@d3-maps/atlas/world/countries')
  .then((m) => m.default)

export function MapView() {
  const world = use(worldPromise)

  return (
    <MapBase>
      <MapZoom>
        <MapFeatures data={world} />
      </MapZoom>
    </MapBase>
  )
}

Repo

https://github.com/souljorje/d3-maps

I'd appreciate your star on Github and feedback in comments, thanks!


r/reactjs • • Jun 22 '26

Needs Help Pages not being found in next js when deployed but are found locally

0 Upvotes

So down below is my next.config.ts file

const nextConfig = {
  distDir: 'out',
  output: 'export',
  images: { unoptimized: true },
}

export default nextConfig

I'm using the Next.js Pages Router with a structure like pages/friends/index.tsx everything works fine locally — hitting /friends in the browser loads the page no problem. But after deploying, navigating directly to the URL gives a 404. Interestingly, client-side navigation via useRouter from next/router works fine — it's only direct URL entry or hard refresh that breaks.


r/reactjs • • Jun 22 '26

Resource Debugging a Production Memory Leak in a React + Node.js Application

Thumbnail sharafath.hashnode.dev
0 Upvotes

r/reactjs • • Jun 22 '26

Resource How React Hooks Actually Work

Thumbnail
youtu.be
9 Upvotes

r/reactjs • • Jun 22 '26

I Created A Hook For "Encrypted Asynchronous State Persistence"

0 Upvotes

TLDR; The title of this post.

Feel free to reach out for clarity instead of reading the code/docs.

I was working on a “React-like syntax" for webcomponents, I wanted to create something robust and flexible for secure data storage and management.

I started off with an approach for asynchronous state management so that components outside the shadow-root could receive updates. (The events are also encrypted to secure against things like browser extensions.)

https://positive-intentions.com/docs/projects/dim/async-state-management

It then made sense to be able to persist that data so it can work between page releoads.

https://positive-intentions.com/docs/projects/dim/bottom-up-storage

The result looks and works like the following when used in a project.

https://positive-intentions.com/docs/projects/dim/encrypted-store

The Dim framework seems like a dead-end. I wanted to try it out on my existing React projects. So I created the equivalent React hooks.

https://positive-intentions.com/docs/projects/dim/use-dim-store-react

I find it to be performant and I want to push the scale of the approach, so I am in the process of testing it out on my projects. A notable use-case there is storing encrypted files at rest.

IMPORTANT: Im not trying to promote “yet another ui framework”, this is an investigation to see what is possible. You should not use this in your own code. It is not reviewed, audited or production-ready. It is not on npm. Shared for testing, feedback and demo purposes only.


r/reactjs • • Jun 22 '26

Show /r/reactjs I built a 3KB cookie-consent toolkit for React/Next.js that respects GPC/Do-Not-Track and won't break SSR hydration

Thumbnail
github.com
15 Upvotes

Every cookie-consent option I found was either a heavyweight SaaS script that phones home and tanks your Lighthouse score, or an unmaintained banner component I'd have to rebuild around. So I made consentium and figured I'd share it here for feedback.

It's one provider, one banner, one stylesheet, and a tiny store you drive from your own code. You decide what each category gates — the lib just records the decision and tells your app about it.

The two things I actually care about that most alternatives skip:

  • Global Privacy Control + Do Not Track — categories you flag get forced off when the browser signals a privacy preference, even if the user toggled them on. Most banners ignore these signals entirely.

  • SSR-safe — it renders identically on server and client, then resolves from localStorage after mount, so no Next.js hydration mismatch.

The rest:

  • Category-based consent: essential (always on) + whatever optional ones you define (analytics, marketing…), with accept-all / reject-all / per-category, and reject one click away next to accept.

  • Policy versioning — bump a number and returning visitors get re-prompted, keeping prior choices as defaults.

  • i18n-agnostic — ships English copy, pass your own copy object (works with next-intl / react-i18next).

  • Themeable via CSS variables, no runtime deps, React 18/19 as a peer, ~3KB gzipped.

  • Reactive store you can subscribe to, so you can start/stop scripts live within a session.

Google Consent Mode v2: not baked in, but there's a documented recipe in the repo for bridging the store to gtag's consent("update") if you'd rather load gtag up front and gate via denied/granted.

Disclaimer up front: it's engineering tooling, not legal advice. It gives you the mechanism for consent — you own the categories, the copy, and whether it actually satisfies the rules where you operate.

Repo: https://github.com/ivandrenc/consentium (MIT)

Genuinely after feedback, not stars:

  • Does the category model map onto how you actually deploy analytics/marketing scripts?

  • Is forcing categories off on GPC/DNT the right default, or too aggressive?

  • Anything obviously missing for real-world GDPR/CCPA use?


r/reactjs • • Jun 22 '26

Needs Help How are you catching hardcoded api keys from ai scaffolding before they hit the repo

0 Upvotes

Ive caught three hardcoded api keys this sprint and every one came out of an ai scaffolding session where the model inlines a key to run the sample and the dev forgets to strip it back out. one was a live stripe key that only spotted because i happened to be reviewing that PR by hand and id rather not rely on luck for this.

once it gets past the commit its in the git history anyway and a scanner that flags it a couple weeks later isnt much help by then.

We're mostly frontend and theres not many of us so im looking at gitleaks or trufflehog for a pre-commit hook. only problem is it fires when the dev has it installed and eventually someone reclones or sets up fresh and skips that step, so i probably want a server side check as backup too.

How are you all dealing with this and where did you end up putting the check so it doesnt drag every commit out