ProgrammerHumor

aThousandLinesDropdownMenu

aThousandLinesDropdownMenu

Context: I could have easily made it under 100 lines, but the 1000 lines for a dropdown is actually more easily managed, I learned the lesson of life,

"Somethings are better off being a Spaghetti "

https://i.redd.it/tjndyzpth3df1.png
Reddit

Discussion

MinosAristos
:py: :ts: :cs:

If your solution for making it under 100 would have been pulling out a bunch of single-use components then my personal preference would also be to keep it at 1000.

Single-use components have their uses (you definitely need some e.g for distinct pages) but they feel way overused and often lead to a ton of unnecessary prop drilling.

9 hours ago
VAIDIK_SAVALIYA OP

EXACTLY! my friend

Plus it would have increased the data layers by making abstractions, and since it has a bunch of functions which are only used once like language switcher (i am not using it anywhere because dropdown is visible on all pages) then there is no need for making different files.

9 hours ago
powerhcm8

I wouldn't try to make a bunch of single use components but maybe try to use a loop create the dropdown items, and an array of items with things like label, icon, state and command function for action.

The dropdowns in my current system aren't that big and I am already thing about doing this.

6 hours ago
MeltedChocolate24
:c::j::ts::py::js:

This is why I have a 6k line component

3 hours ago
SkurkDKDKDK

I just love When devs are showcasing code. There’s jackpot for “I haven’t optimized the code” every time 😂

9 hours ago
VAIDIK_SAVALIYA OP

hahaha, true

9 hours ago
LavaCreeperBOSSB

I know shadcn when I see it

4 hours ago
VAIDIK_SAVALIYA OP

We are alike, infact any component with Content will be shadcn forsure,

4 hours ago