• YIj54yALOJxEsY20eU
    link
    fedilink
    arrow-up
    6
    arrow-down
    1
    ·
    edit-2
    8 months ago

    I hate that the convention for naming React.useState variables is [color, setColor], rather than [color, colorSet]. After I declare ‘color’, I want to copy/paste that variable and append ‘Set’, rather than copy the variable then writing ‘set’ then pasting then navigating to the 4th character then flipping the case.

    Granted there could be some ambiguity if there was a variable containing a unique collection (aka set) but that is far less common than declaring a useState variable. I’d even settle for appending ‘SET’ to quell the confusion.