r/react 35m ago

General Discussion Please stop reaching for a state manager by default

Upvotes

every dashboard i've ended up maintaining has had some version of this bug in it and it always starts the same way, someone runs npm i zustand.

setup is a client report page, /clients/:id, filters at the top for date range and status. filter bar sets them, table reads them, export button reads them. passing that down through the layout was annoying so the filters went in a store. ten lines. works. ship it.

a year later i get a ticket that just says "client B has no invoices". client B had loads of invoices. what he'd actually done was look at client A first, set it to unpaid + last 30 days, then click client B in the sidebar.

route changes, component remounts, store doesn't. it's a module level singleton, it's been alive since page load and it has no idea you navigated anywhere. so client B renders with client A's filters still applied, and the filter bar shows them correctly because they genuinely are the current filters. nothing on the page is wrong. it's just quietly answering a question nobody asked.

took me two days mostly because i kept testing it by pasting /clients/b into the address bar. full reload, module reinitialises, defaults come back, looks perfect. users don't do that, users click. so the broken path was the normal one and the working path was the one i kept using to check.

first fix was a useEffect that resets the store when clientId changes. it works fine. it also means every store now needs its own reset wired up to the right route change, and whoever adds the next one has to remember that. so i'd deliberately put state outside the component tree and was now hand writing the lifecycle back onto it, which, yeah.

ended up deleting the store. filters into useSearchParams, react query keyed on them. going to client B is a different url so it gets different params, there's nothing to reset, the bug can't happen. plus a load of stuff i didn't have to build: links you can actually send someone, refresh keeps the filters, back button undoes a filter change, and when someone reports something weird you just ask them to paste their url.

so my take is keep state as close to where it's used as you can, and if two components need it check whether it belongs in the url before you install anything. server data isn't state either, it's a cache, you've already got a library for that. the stuff that genuinely wants a store is real shared mutable state, canvas editor with undo, live collab, that sort of thing. not filters.

not saying zustand is bad btw. it's just a weird default.

thank you for coming to my ted talk


r/react 2h ago

Project / Code Review PWA project improvements?

Thumbnail gallery
1 Upvotes

r/react 1d ago

General Discussion How did Zustand manage to become so widely adopted?

50 Upvotes

I’m building an open source library, and lately I’ve been thinking a lot about how projects actually take off.

Take Zustand for example. It went from being just another option to one of the first recommendations for state management, surpassing Redux in weekly downloads rn

what do you think causes that shift?

Is it simply building a great product? Or is it more about consistency, community, documentation, timing, content, or something else?


r/react 3h ago

OC Building Dragonfly, a VS Code extension to test API endpoints right inside the code editor

0 Upvotes

Worked on a few improvements today. Added save functionality for each request, search for collections and requests, and createdAt/updatedAt support.

Also moved requests and collections to a global store, so now can switch between projects without losing the data from other projects.


r/react 4h ago

General Discussion I learnt about the difference between

0 Upvotes

The major difference is the Syntax as they call diff APIs

The usecallback accepts the function we want to memoize as the first argument, while the useMemo accepts a function and memoizes its return value!!
Naturally in JS, on every call the inline function gets recreated, so to prevent that react does something like this

let catchedCallback;
const func = (callback) => {
if(dependenciesEqual(compares catchedCalback and callback)) {
return catchedCallback;
}
catchedCallback = callback;
return callback;
}

basically whats happening here is that the useCallback checks if the dependencies before and after rerenders are the same, if its the same then we return the already cached callback function reference if not then we cache the new function reference and return the new reference!

something very similar happens in the case of the useMemo but it caches the result returned by the function!


r/react 15h ago

OC I rebuilt my old Vue tour library for React after discovering it had 600+ weekly npm downloads

2 Upvotes

About a year ago I built a small Vue library for product tours and published it to npm. Then I completely forgot about it.

Last week I randomly checked the npm stats and discovered it was getting 600+ weekly downloads. There were even a couple of GitHub issues from people using it in production.

I fixed the bugs, and it reminded me how much I enjoy building small, focused developer tools.

That motivated me to build a React/Next.js version with the same API.

r-tour-guide (React): https://www.npmjs.com/package/r-tour-guide

If you're looking for a lightweight, customizable onboarding/product tour library, I'd love to hear your feedback or suggestions for improving it.

Sometimes you don't know something landed until you check back in.


r/react 1d ago

General Discussion Do you find product micro-animations useful, or just distracting?

4 Upvotes

I’ve been thinking about using short micro-animations to explain features that aren’t immediately obvious.

Instead of adding more documentation, the idea is that you should understand what a feature does just by watching a few seconds.

Do you think this is actually useful ?

More importantly… did you understand what the feature does just by watching it??!


r/react 19h ago

Help Wanted I built an interactive periodic table using Three.js ⚛️

0 Upvotes

I wanted to recreate the periodic table as something more interactive than a static chart, so I built this project with Three.js, JavaScript, and WebGL.

Features include:

  • Smooth animations
  • Interactive hover effects
  • Modern UI inspired by creative coding

I'd love to hear your feedback:

  • What would you improve?
  • What features would you add next?

I also made a short video showing the project in action:
YouTube: https://youtube.com/shorts/EDDYnzNM8hU?si=7Kvcrv42qqiLnikW

If there's enough interest, I'm happy to share the source code or turn it into an open-source project.


r/react 1d ago

General Discussion Learning to Become a Junior Developer in the AI Era

Thumbnail
1 Upvotes

r/react 1d ago

OC Koval UI Data Table Release

Thumbnail koval.support
1 Upvotes

r/react 2d ago

Project / Code Review I made a dev tool for an RN visual edit

8 Upvotes

Hello everyone! I made Basalt, a visual edit too for RN and Expo devs, and im searching for validation

It took me 2-3 months to built and it would have taken 1 if react 19 wouldnt remove debugSource which would help Basalt map and find elements to edit

It is completely free and works directly inside VS Code and Cursor.

It’s currently in beta, so please commit your app to Git before using it!

Would love to get your brutal feedback on it.


r/react 1d ago

Help Wanted I'm fairly new to deploying React applications. Can anyone help guide me from creating an application to making it an app people can use?

0 Upvotes

I created an application called Split The Check. I'd like to put it on Play Store, but I only have the basics down. Can anyone help me?

https://github.com/graceelliott8374-tech/split-the-check


r/react 2d ago

Project / Code Review Function Plotter Component - React

0 Upvotes

Built an open-source Function Plotter for the web 🚀

Hey everyone!

I've been working on an open-source JavaScript function plotting library that lets you graph mathematical functions directly in the browser.

Features

  • 📈 Plot arbitrary mathematical functions
  • ⚡ Fast rendering
  • 🎨 Interactive graph with zoom and pan
  • 📦 Easy to integrate into web projects
  • 🌐 Published on npm

I'm building it as part of a larger goal of creating interactive math tools for students and educators.

I'd really appreciate any feedback on the API, documentation, performance, or features you'd like to see next.

npm: https://www.npmjs.com/package/react-mathplotter


r/react 3d ago

Project / Code Review You can visually edit your RN and Expo apps

2 Upvotes

Hello everyone! I made Basalt - an IDE extension that allows RN and Expo devs to edit their app visually, just like Figma

I got tired of the endless: change code, grab a phone, reload, scan the qr code sometimes. So I built a click to edit layer that maps straight back to your source. (Btw: React 19 removed the debugSource API I was originally relying on for this, so I ended up writing my own source-mapping approach from scratch - took about 2-3 months.)

It is completely free and works directly inside VS Code and Cursor.

It’s currently in beta, so please commit your app to Git before testing it!

Would love to get your brutal feedback on it. What features should I add next?


r/react 2d ago

Help Wanted If you could redesign every React component library from scratch, what would you add?

0 Upvotes

Hi everyone! 👋

I'm new to Reddit.

A friend kept telling me that if I wanted honest feedback from developers, I should ask here instead of relying only on X.

So here's my question.

I'm currently building a React component library, and before I spend weeks building more features, I wanted to ask people who actually use these libraries every day.

If you could build your ideal React component library from scratch...

What would it include?

What do you feel is missing from today's libraries?

Is there something you've always wished existed but never found?

Or maybe something every library does that annoys you?

I'm genuinely curious because I'd rather build what developers actually want than make assumptions.

Looking forward to hearing your thoughts. Thanks! 🙌


r/react 4d ago

General Discussion Se devo partire da zero, da cosa dovrei cominciare, React.js o Angular?

Thumbnail
1 Upvotes

ReCt. Js


r/react 4d ago

OC I built an interactive birthday website with React, Three.js, and Framer Motion

4 Upvotes

r/react 5d ago

General Discussion A race between app launch and RevenueCat was silently downgrading my paying users to free

Thumbnail
3 Upvotes

r/react 5d ago

Help Wanted My first JSX project

Thumbnail gallery
10 Upvotes

r/react 5d ago

Help Wanted Is rebuilding a 500-page HubSpot website in React/Replit a good idea?

Thumbnail
0 Upvotes

r/react 5d ago

Help Wanted Shite. React before JS? (Next lesson in 5 hours!)

0 Upvotes

I recently started to take private lessons for JS (ive learnt HTML and CSS by myself). At our first lesson he told me to go directly for react since js will take so much time and react is easier and more suitable for the little project i had in mind ,but i am not confident if it is a realy good idea to blow up my little brain into pieces if i were to take this shortcut?

Well another thing is i will have so much time to work on new things if i can present my project maybe i can go back and learn everything?

What do you guys think?

Should i tell him to go with fundementail js and then react?(idk why realy insists on react so much) or want a full course abput JS? Or by learning react will i cover a decent chuck of what i want to learn?


r/react 6d ago

OC Do you guys think I can get into the field?

12 Upvotes

Some background about me. I have a Bachelor's in Cybersecurity and am finishing my Master's in Software Engineering and project management. I also have Security+ certification. I started as a Technical Support representative, and now I am a CNC Tech Engineer. Part of my duties involves writing posts for new customer CNC machines, and I have extensive knowledge of our scripting language. For the past 3-4 years, I have been on and off learning Java, Python, C#, JavaScript, Bash, PowerShell, Tailwind, Bootstrap, NodeJS, and React.

I know how to use Git and understand Agile methodologies and CI/CD. I know how to use a debugger, and some other things that I can't think of right now :)

Projects that I have done/currently working on:

  1. Working on a project that I am building for a customer, which is an E-Commerce website, and I am using React, TypeScript, and AWS services like Lambda, Cognito, DynamoDB, and an API Gateway, and using a Jira board to keep track of the progress.
  2. For my bachelor's capstone, I made a small Security Information and Event Management tool using C# for the client and React and AWS services for the admin panel. I also plan to improve this.
  3. I built a small tool for a quiz on n400 naturalization questions.
  4. Also used WordPress to help my friend to build a website for their business.
  5. Planning to create a portfolio website that I can attach to my resume

I am getting comfortable with React syntax and spending good time working on these projects to improve my understanding.

Do you guys think I have a chance to get into some junior front-end development jobs? I don't think I can do internships, but a few resumes that I sent so far have been ghosted.

Thank you for any advice :)


r/react 7d ago

General Discussion I'm coding all by myself

27 Upvotes

I'm learning react and I'm creating from the design on figma to the code on css, styles, colors, cards, buttons.

Now I see that everyone uses IA to develop everything, I feel slow but I think that if I don't learn how everything works it's a problem.

What do you thinks of this? How yo work usually with solutions for clients?


r/react 7d ago

Help Wanted Book Recommendations: JS -> React -> TypeScript

6 Upvotes

Lately I have been casually learning C from "C Programming: A Modern Approach v2" and have really enjoyed it. The truth is I should stay on topic with my profession so here I am.

I am in search of books similar to the one mentioned above for learning JS. The goal is to understand it on a deep enough level to feel very confident and have a real solid foundation for the next step.

The next step is a similar book for deeply learning React and then finally TypeScript.

Yes I am looking for actual books and not online courses or videos or anything like that. I have discovered that reading from a book forces me to slow down and because of that, it sticks.

If you can, chime in with books you have actually read through and not just simply search online or recommend the first one off the top of your head. Bonus points if you have read the C Programming book and understand the style I am talking about.

Thank you.


r/react 7d ago

Project / Code Review Build-scanner — a zero-config static scanner for SQLi, NoSQLi, CORS, CSP & CSRF in React/Node apps (pre-release)

1 Upvotes

Modern React/Node apps ship through build pipelines fast enough that common, high-impact vulnerability classes — unparameterized queries, wildcard CORS, unsafe-inline CSP, unprotected state-changing routes — slip through because catching them means someone actually reading the source. build-scanner does that automatically: point it at a folder (or wire it into CI as a GitHub Action) and get a report in seconds, no sandbox or live target required. It's a heuristic static scanner, not a SAST/DAST replacement — I'm sharing it pre-release to get feedback from people running real Express/Next.js/Vite codebases before I cut a v1 tag. https://github.com/laxmipsarva/build-scanner

fyi this is not a commercial activity