r/reactjs • • 14d ago

Resource πŸ—ΊοΈ Roadmap to Query v6 Β· TanStack query Β· Discussion #12669

Thumbnail
github.com
108 Upvotes

πŸ“’ Please don’t get excited, but we’ve started working on TanStack Query v6. We’ll break things, but not too many.

Feedback appreciated πŸ™


r/reactjs • • 26d ago

Show /r/reactjs react-brackets: tournament brackets for React

Thumbnail
react-brackets.oulabi.dev
63 Upvotes

Back in 2020 I published react-brackets, a small component for tournament brackets. I shipped a few versions, got busy, and stopped touching it in 2022.

The library didn't stop, though. Four years later it was still pulling ~11,800 downloads a month, sitting at 136 stars and 65 forks, with issues piling up that I never answered. It was built on styled-components and an abandoned swipe library, only did single elimination, and its connector lines were CSS pseudo-element hacks that broke if you changed a card's size.

People were depending on something I'd walked away from. So I rebuilt it from scratch.

What v2 is:

  • Every common format: single and double elimination (with a grand final reset), round robin, Swiss, two-sided brackets, groups to playoffs

  • Headless: semantic markup with data-* attributes, so you style it with Tailwind, CSS modules, or the optional theme

  • Connector lines measured from your real cards: any card size, any custom match component, right-to-left layouts all just work

  • Actually usable on a phone: one round at a time, still drawn as a bracket, with a swipe that follows your finger

  • Zero runtime dependencies besides React, under 14 kB gzipped

  • A framework-free core (@react-brackets/core) for the logic: seeding, byes, results, standings

Getting the swipe to feel native on iOS was the hardest part. Safari animates cards on the GPU on its own clock, while the connector lines are drawn by JavaScript, so the lines kept trailing the cards by a few frames. The fix was to drive both from one clock in the same frame.

It's a ground-up rewrite, so it's a breaking change from 0.x. There's a migration guide, and the old code lives on the legacy branch.

If you were one of the people still using the old version: sorry for the silence, and thank you. I'd love feedback, especially on formats or use cases I haven't covered.


r/reactjs • • 15d ago

Discussion Beginner learning React + Vite: Should I stick to plain CSS, switch to Tailwind CSS, or use a UI library?

44 Upvotes

I'm currently learning frontend development with React and Vite, and I want to make sure I'm focusing on the right tools to become job-ready.

Right now, I'm practicing plain CSS to understand layouts and styling fundamentals. However, I see almost everyone recommending Tailwind CSS or component libraries like shadcn/ui and Material UI.

At what point should a beginner move from plain CSS to Tailwind?

Do companies expect you to know Tailwind, CSS Modules, or both?

Are UI component libraries bad for learning when you're trying to build a strong portfolio?

Would love to hear what your workflow looks like in real-world projects!


r/reactjs • • 25d ago

Discussion How do you structure feature-based React apps with Zustand, TanStack Query, providers, and business logic?

39 Upvotes

Hey everyone! πŸ‘‹

I'm trying to establish a clean, reusable feature-based architecture for React/TypeScript apps, especially when using Zustand + TanStack Query.

I'm working on a visual editor that fetches documents from an API, initializes a Zustand editing session, and will eventually handle canvas state, selection, history, saving, etc.

I'm considering this structure:

features/editor/
β”œβ”€β”€ components/
β”œβ”€β”€ hooks/
β”œβ”€β”€ store/
β”‚   β”œβ”€β”€ editor-store.ts
β”‚   β”œβ”€β”€ editor-store-provider.tsx
β”‚   └── slices/
β”‚       β”œβ”€β”€ document-slice.ts
β”‚       β”œβ”€β”€ selection-slice.ts
β”‚       └── history-slice.ts
β”œβ”€β”€ queries/
β”œβ”€β”€ domain/      ?
β”œβ”€β”€ utils/       ?
β”œβ”€β”€ lib/         ?
└── services/    ?

I'd love to know how you handle a few things in production:

  1. API / queries: Where do raw API functions go? Do you separate them from TanStack Query options/hooks? Do you organize queries by feature or shared domain?

  2. Zustand: Do you keep providers alongside stores? When do you introduce slices vs multiple stores?

  3. Business/domain logic vs utilities: This is probably what I'm most unsure about. Where do you put pure functions containing actual application logic, independently of React, Zustand or API calls? For example: Would a domain/ directory make sense here? For example, domain/geometry.ts for canvas calculations, domain/document.ts for document manipulation, etc. Or would you simply use utils/, lib/ or services/? How do you distinguish business/domain logic from generic utility functions? Is a dedicated domain/ folder a useful convention, or does it introduce unnecessary complexity?

    • Formatting an aspect ratio.

    • Calculating canvas geometry, scaling or snapping.

    • Validating editor-specific constraints.

    • Transforming or manipulating document data.

  4. Shared code: When do you move something out of a feature into a shared location? Do you prefer shared domain modules or global utilities?

  5. Server vs local state: Would you fetch with TanStack Query, initialize Zustand from the result, then keep local edits separate from the query cache? How do you avoid overwriting unsaved changes on refetch?

I'm not looking for a strict architecture or lots of abstractions, just practical conventions that stay maintainable as projects grow.

If you have real-world folder structures or examples, I'd love to see them. Thanks! πŸ™


r/reactjs • • 8d ago

Resource I built animated characters that replace the three-dot loading indicator

Thumbnail
mien.hazem.design
36 Upvotes

AI apps spend a lot of time thinking and most just show three dots. I wanted something that actually communicates what’s happening.

So I made Mien β€” 40 characters with up to 62 moods each (thinking, listening, searching, uploading, celebrating, sleeping…). You change the mood with one line of code and it morphs smoothly, even in the middle of an animation.

You can also design your own character in the studio with custom expressions and animations.

Works with React, Vue, Next.js, Svelte, or plain websites.


r/reactjs • • 8d ago

At what point did you stop prop-drilling and reach for context or a state library?

29 Upvotes

I'm learning React while working full-time, building small projects (a portfolio site and a small clothing-brand site). Right now I mostly pass props down, and it works fine for small stuff, but once a component tree gets a few levels deep it starts feeling messy. For people who've built real projects β€” what was the moment you decided props weren't enough anymore? Was it a specific app size, a specific pain, or did you just start with context or Zustand from the beginning? Curious how others made that call.


r/reactjs • • 27d ago

Show /r/reactjs I built the same two charts in six React chart libraries and in hand-written SVG, and timed them

27 Upvotes

The charting library in a product I worked on had not had a release in over a year, so I wanted to know what we could move to. I built a survival curve and a scatter plot in nivo, Recharts, ECharts, visx, TanStack Charts and Chart.js, plus a version in plain React and SVG. Same spec, same data, timed the same way.

What I found (M3 Pro, headless Chromium, native speed):

- At typical dashboard sizes there was no clear speed winner. The timings for each chart were within one frame of each other.

- At 10,000 scatter points they spread out: hand-written SVG 24 ms, visx 33 ms, TanStack Charts 53 ms, Chart.js 80 ms, ECharts 86 ms, Recharts 310 ms, nivo's SVG scatter 3.2 s.

- Both Canvas implementations took longer to mount than plain SVG at that size.

- TanStack Charts needed the least code. Hand-written SVG added the least JavaScript, about 2 KB gzipped against 25–164 KB.

There is a playground where you can paste your own data and measure the libraries on your own machine, across twelve chart types: https://gusevp.github.io/chart-bench/

Code, raw data and notes on each port: https://github.com/GusevP/chart-bench

Full write-up with the method and limits: https://dev.to/gusevp/six-react-chart-libraries-against-hand-written-svg-what-i-found-46ib

One machine and two chart types, so treat it as a starting point. If I used your favourite library wrong, tell me or open a PR.


r/reactjs • • 1d ago

Resource We recently cut down our React GitLab CI pipeline from ~15 min to 6 min using memoization and I have some thoughts to share

26 Upvotes

We are a three-person team where tech lead is more focused on management than technical work, so we often end up reinventing the wheel due to gaps in our knowledge. Recently, we realized we were waiting 15 minutes for an image to build on every push and usually we have to make two to three commits to get all pipeline stages passing (AI not doing its job properly and test coverage falls short.)

That's when I looked more into our React repo’s GitLab CI pipeline. The historical median was 14m 48s (p90 24m 51s). Earlier runner and test-suite updates had already brought runs down to about 9 minutes. After applying memoization across our jobs, the median was 6m 19s, with a best run of 5m 07s.

Here are the changes we made:

  • Decoupled install from test:unit and enabled the shared S3 npm cache keyed by package-lock.json. Install dropped from ~110s to 45–54s.

  • Skipped lint, typecheck, and test:a11y on pushes that don’t touch app code using rules:changes and optional: true in downstream needs.

  • Gave test:unit two modes. It runs the suite when test inputs change. On no-code pushes it fetches prior test and coverage artifacts via CI_JOB_TOKEN so our policy gates still pass. Reuse took 17–18s versus 2m 20s for a full run. We also replaced grep | head -1 with a single awk command after SIGPIPE caused an exit 141 under pipefail.

  • Moved Kaniko’s --cache-repo to the GitLab Container Registry after ECR returned a 403 for cache-layer uploads. The final image still goes to ECR. The build took 2m 20s cold and 36s warm on an unchanged-source push.

While none of this is groundbreaking, I got to implement it for our team and cut a real daily bottleneck and I feel good about it.

https://medium.com/@veldt/how-i-cut-my-gitlab-ci-pipeline-from-18-minutes-to-5-minutes-using-memoization-cd743108702d

Personal Blog


r/reactjs • • 23d ago

News This Week In React #305: X, Forms, e18e, Next.js, TanStack Start, Storybook, MobX, Zustand, XState | Exact, Discord, Shopify, Expo Modules, Audio API, Bottom Sheet, Keychain, Gesture Handler | Node.js, Safari, Rolldown, Playwright

Thumbnail
thisweekinreact.com
26 Upvotes

r/reactjs • • 15d ago

Show /r/reactjs Built an open-source cyberpunk component kit for React (69 components, installs through the shadcn registry)

25 Upvotes

Hey guys! I've been working on a React component library for interfaces that look like they belong on a Cyberpunk's universe. Live signal graphs, glitchy buttons & drawers and interactive maps.

It's built on UI SDK and distributed through the shadcn registry. So you don't install a package (aside from shadcn of course); the source and plain CSS go straight into your project so you can change anything.

What's in it:

  • 69 documented components, from buttons, tabs and sliders to calendars, feeds, charts and maps

  • 7 complete example screens built only from the kit

  • 32 interactive recipes with source and install commands

  • A customizable accent color and effects, plus optional interface sounds

  • An agent bridge, so AI coding agents can drive controls by name, and a setup prompt for having an agent build a screen with it

Install it (React 19 with shadcn set up):

bunx --bun shadcn@latest registry add '@cyberspec-ui=https://www.cyberspec.dev/r/{name}.json'
bunx --bun shadcn@latest add /cyber /button

Website, demo and docs here: cyberspec.dev
Quick video demo here: https://youtu.be/yQSZhNekK7U

Working on another theme as well, hit me up if you're curious!

Anyways, would love some feedback! πŸ™ Specially with this many visual effects, components you'd want added, and whether the registry install felt smooth. Happy to answer questions about how it's built.


r/reactjs • • 4d ago

Needs Help How much coding do you actually need to know to build a small internal react app?

20 Upvotes

Say you work at a small accounting firm and want to build something to keep track of clients, documents and deadlines instead of having everything scattered across spreadsheets. If AI builds the React part and Supabase handles the database and logins what else would you actually need? The part that confuses me is how you make sure only the right people can access certain data. Is that something you can set up within the app or do you need to write a separate backend for it? Trying to understand how realistic this is for someone who isn't a developer.


r/reactjs • • 3d ago

Discussion Learning React after work β€” rebuilding the same small project keeps teaching me more than new tutorials do

14 Upvotes

I'm in my third year of BCA and working in digital marketing, so I learn React in the evenings. Tutorials always make sense while I'm watching them, then I sit down to build something on my own and half of it falls out of my head. What actually helped was picking one small project and rebuilding it again from scratch β€” each time I notice something I misunderstood the last time, like when state should live in the parent or when a component is doing too much. Has anyone else learned this way, or did you get further by jumping to a new project every time?


r/reactjs • • 20d ago

Discussion Is there a resource showing best practices for Motion animation?

11 Upvotes

Hopefully this makes sense, and apologies if I'm in the wrong subreddit.

I'm looking to improve at Motion and CSS animations, and am wondering if there are any resources that detail common animation practices for web components.

For instance, when animating a button, it's common to move it slightly on the Y axis, and adjust it's scale with a dampened spring.

If you know where I can find out more, I'd greatly appreciate it. Thanks


r/reactjs • • 23d ago

Resource React Anatomy: See how your layouts are composed in an exploded 3D view

11 Upvotes

React Anatomy is a browser extension that adds an Anatomy panel to DevTools, connecting the visible page to the components React rendered.

You can pull the layout apart into 3D layers, click something on the page to find its component, focus on a subtree, and inspect its live props. The tree shows rendered instances, so a component used five times appears five times.

It’s a way to understand an unfamiliar layout, investigate unexpected nesting, or get a visual to help explain a change in a pull request. It can also help when an AI agent composes a React page and you want to understand the structure before taking over the code.

It works on an existing React app without adding anything to your code. Development builds give you clearer component names.

Free, MIT-licensed, and available for Chrome and Firefox. There’s an interactive example you can try without installing anything.

Where would this help in your React workflow? What would make it more useful when exploring an unfamiliar app?


r/reactjs • • 7d ago

Show /r/reactjs I made a little library of React motion and interaction studies

10 Upvotes

I made this mostly for myself because I like messing around with motion and small interaction details in interfaces. Figured I'd put everything in one place and share it here.

There's a mix of stuff like draggable workspaces, spring animations, connectors, typography experiments and a few more unusual interactions. You can play with the demos and download the source if you want to use anything.

The React components use scoped CSS, caller-owned state and callbacks. The spring solver has tests for damping and retargeting, and the gallery has browser tests for pointer gestures, keyboard controls and reduced motion. Some of the library is adapted from upstream projects, with attribution in the README.

Site: https://design.querencia.art/ GitHub: https://github.com/0xque/design Spring implementation: https://github.com/0xque/design/blob/main/src/library/PhysicsMotion.tsx

I'm still adding stuff to it. Let me know what you think or if there's anything you'd change, especially around making the interactions reusable in React.


r/reactjs • • 4d ago

News One Year After React2Shell Patch, Thousands Of Servers Are Reported To Have Had Keys Stolen

7 Upvotes

CloudSEK has published a report on November 30, detailing a campaign they are calling React2Keys. Tens of thousands of credentials from thousands of hosts, per CloudSEK.

They got the keys, tested them, used them and charged victims for using AI/Cloud under their stolen keys. They also added new SSH keys to the servers without the server owner's permission.

Upgrade to 19.0.1, 19.1.2, 19.2.1+, or patched Next.js version. Take all the secrets that were stored on the server, cycle them through. Revoke the old keys. Check the authorized_keys of your accounts, and toss any SSH key which you can't associate with a person or system. You should look at the November bills for the accounts that you can access with those keys and see if there is any usage you don't recognize.

Also reported this week by SecurityWeek and CSO Online. The fact the flaw exists, the fixes and the CISA KEV listing are all public knowledge. So the "patch & rotate" part is worth doing even just based on that.

https://hol.org/blog/cve-2025-55182-react2shell-react2keys-campaign


r/reactjs • • 16d ago

News This Week In React #306: UI SDK, Fate, RSC, Next.js, Dragology, Helmet, React Flow, Virtualized, Anatomy | Expo Simulators, Exact, Bottom Sheet, Node-API, Graphite, Navigation, Nitro SQLite, Trading Charts | Solid, webpack, Node.js, Oxlint, npm, pnpm

Thumbnail
thisweekinreact.com
7 Upvotes

r/reactjs • • 25d ago

Show /r/reactjs React Brackets Native

7 Upvotes

A few days ago I shared react-brackets v2, the rewrite of a bracket library I'd left alone for four years. The most common question was "does it work in React Native?" It didn't. Now it does: https://react-brackets.oulabi.dev/ is out.

It draws the same stages as the web version (same core, same data), but everything you touch is native:

  • A bracket, even on a phone. One round at a time, with the next round and its lines waiting at the edge. Swipe and every match glides into place. Or show each round as a plain list, or keep the whole tree and pinch, drag and double tap to zoom.

  • Every format: single and double elimination, round robin, Swiss, groups to playoffs, two-sided brackets.

  • Cards that open. Each card keeps its own height, so you can expand one (rosters, stats, whatever) and the bracket makes room: the cards below move down, the next round re-centres, and the lines follow, all gliding.

  • Right to left, following your app's direction.

  • Styled your way: a light and dark theme, and a style on every part that can depend on its state, so it works with StyleSheet, Uniwind/NativeWind or Unistyles.

The hardest part was keeping the connector lines glued to the cards. My first version drew them on a Skia/SVG canvas, and during a fast swipe they visibly trailed the cards by a frame. The fix: the lines are plain Views moved by the same transforms as the cards. Every card's place on every round is worked out up front, and a swipe only moves one number on the UI thread. React hears about the new round once the swipe lands, so nothing re-renders while your finger is down.

It needs the New Architecture, Reanimated 4 and Gesture Handler 3, and Expo Go includes all of them. I've tested mostly on iOS, so feedback from Android devices would help a lot.


r/reactjs • • 8d ago

News This Week In React #307: Security, React Router, Next.js, TanStack Query, RTL, RTK, Styled Components, Talata, Pierre | Reanimated, Worklets, Expo, Skia, WebGPU, Unistyles, Legend List | TC39, Node.js, Parcel, Firefox, webpack, Nudeps

Thumbnail
thisweekinreact.com
6 Upvotes

r/reactjs • • 2d ago

News This Week In React #308: Next.js, Storybook, Security, RSC, INP, Hyper Elements, GTKX, RTK, Immer, Jotai | NitroUI, Expo Router, Fabric, RTL, DevTools, Zalando, Safe Areas, Metro, Agents | Effect, Vite, CSS, Node.js, tidy, Rolldown

Thumbnail
thisweekinreact.com
5 Upvotes

r/reactjs • • 9d ago

Show /r/reactjs I made a React UI kit inspired by the Minitel, the French Videotex terminal: 40Γ—25 grid, mosaic graphics, 1,200 baud reveal

5 Upvotes

videotex-ui is an open-source React UI kit that draws interfaces the way French Videotex did: a 40 Γ— 25 character grid, 8 colors, 2 Γ— 3 mosaic graphics and the 8 function keys of the Minitel.

Technical details

  • Values from the spec. Grid size, colors and their grey levels, mosaic codes and line timing were checked against the Minitel 1B specifications (STUM). Each value cites its source in docs/SPECS.md.

  • 1,200 baud reveal. Each character costs 10 bits on the line (start bit, 7 data bits, parity, stop bit), so 120 characters per second: a full page of 1,000 characters takes about 8.3 seconds.

  • Sharp mosaics. Each mosaic cell is drawn with CSS background layers in currentColor. The screen picks the largest whole-number scale that fits, so every dot lands on whole pixels.

  • Accessibility. Screen readers read the text of the page, not the grid. Titles, menus, inputs and function keys are real headings, lists, inputs and buttons. prefers-reduced-motion turns off blinking, flicker and the progressive reveal.

  • Two modes. Title, StatusRow, Menu, InputField, Frame and Mosaic work on the 40 Γ— 25 screen, or on their own in a normal page.

  • Server-friendly. The core (PageBuilder, palettes, mosaics) is plain TypeScript without React, so a React Server Component can build a page and pass it to <Screen>.

  • Picture to mosaic. A converter turns a picture into mosaic characters in the browser (nothing is uploaded), and the library can export the result as a PNG or a ready-to-paste React component.

  • No runtime dependencies; React is a peer dependency.

Install

npm install videotex-ui

or copy the source into your project with the shadcn CLI:

npx shadcn@latest add https://cdn.jsdelivr.net/npm/videotex-ui/r/screen.json

Example

const page = new PageBuilder()
  .moveTo(3, 2).print('HELLO', { fg: 'yellow', size: 'double-size' })
  .moveTo(5, 2).print('Type your choice then ')
  .print(' Send ', { inverse: true })
  .build();

<Screen page={page} crt baud={1200} aria-label="Home" />

This is version 0.1.0. I would like feedback on the API and on accessibility in particular.

Minitel is a registered trademark of Orange. This project is independent and is not affiliated with, sponsored or endorsed by Orange.


r/reactjs • • 11d ago

Show /r/reactjs Sliding-panes React UI library (inspired by WebOS Enyo)

Thumbnail
vcarl.com
5 Upvotes

I didn't find a panes-based layout tool that I liked, so I made it! I always loved the way that WebOS panes layouts worked, so I took heavy inspiration from those.

https://github.com/vcarl/sashay https://npmx.dev/package/@vcarl/sashay


r/reactjs • • 24d ago

Resource Puck Editor: A deep dive with the creator Chris Villa

Thumbnail
youtube.com
5 Upvotes

I sat down with Chris Villa, the creator of the puck editor.

0:00 Who is Chris Villa and what is Puck
1:36 Where the name Puck comes from
2:51 Live demo: Puck inside a headless Drupal site
5:24 MIT, and close to 3 million downloads a month
6:10 What the Puck editor actually is
7:58 The origin: design systems and the dev sprint bottleneck
10:09 The Hacker News launch
11:13 Going full time, and agents producing off brand interfaces
13:38 Puck AI, the Puck cloud and a page backend
15:21 A team of three, questioning old assumptions
16:47 Why pay for Puck AI if you can build it yourself
17:26 "What Vercel is to Next.js"
20:28 The hardest problem: multi dimensional drag and drop
24:14 Viewports, zoom, iframes, and working with dnd kit
26:49 Revenue, angel investors and fundraising
27:44 GitHub, Linear, and "I don't code much anymore"
29:24 Conductor, Boxes.dev and building the agent factory
30:31 Writing tickets is the new bottleneck
32:55 Can you test whether an interface feels right?
34:57 AI slop pull requests, and agents that reply for you
38:42 Discord, and why the community got quieter
39:21 Do we still need websites?
41:46 From 130k to 2.8 million downloads: agents are the driver
44:02 A longer tail of SaaS, each product more full stack
46:31 The dark forest and the cozy web
48:03 Build for the agents: types, CLIs and llms.txt
51:43 Where to follow Chris


r/reactjs • • 26d ago

Show /r/reactjs Foldable phone support for React: hinge detection and two-pane layouts in ~2 kB

5 Upvotes

A recent audit I ran showed 94% of popular sites split a button across a foldable's hinge (https://christophe77.github.io/fold.js/study.html).

So I made u/foldjs/react: a hook that give you the hinge position and posture (flat, book, tabletop), plus a two-pane layout component that never puts content under the hinge. It ships with a built-in simulator, so you can work on it without owning a Fold.

Demo (works on desktop): https://christophe77.github.io/fold.js/

I'd love feedback on the API, especially from anyone who has shipped foldable layouts in production.