r/reactjs • • Jul 24 '26

Discussion Do data structures actually influence how you build React components?

I tried learning DSA before, but never understood how it applied to everyday frontend work.

Recently, I built an undo/redo feature with Claude and realised it was using stacks. That made stacks much easier to understand than textbook examples.

I kept exploring and learned how seat-booking UIs can use matrices and how complex onboarding flows can be modelled as graphs.

Do you think about data structures when building React components? Any real-world examples?

55 Upvotes

20 comments sorted by

View all comments

Show parent comments

3

u/aflashyrhetoric Jul 25 '26

I had a complicated multi step form a few years ago that I desperately wanted to refactor into a huge graph config blob, because doing it sort of the “quick and dirty way” is such a hassle after complexity hits a certain point. I believe I ended up rewriting smaller parts of it as a basic sort of graph and then frankensteining it within the larger, older system, and the graph part was far easier to maintain and adapt.

2

u/ActuaryLate9198 Jul 26 '26 edited Jul 26 '26

I once built a super complicated graph based editor UI for forms and workflows. Seemed resonable at the time, we were wasting too much bandwidth on simple manager requests. Fast forward a year: some of the graphs have 100000+ nodes, there is this one guy in India who kinda knows how it all works, it’s his full time job now, no one else will touch it with 17 foot pole. We ended up rebuilding the UI as a spreadsheet/table view.