Lurker News
Hey HN, this site always drags me back to visit it everyday. So for that Happy New year !

Comments (258) 159 threads

Show all comments

Showing thread 85 of 159

ashafq3 replies#
++year;
bdangubic1 reply#
don’t start the year by mutating state, geeeeeez :)
User231 reply#
It's not mutating state, it's defining a transition function from one immutable state to another!
nejsjsjsbsb#
[year, setYear] = useState(2024)

Get off my lawn means no libraries, just web api.

pryelluw#
year = year + 1
insin#

    setYear(year => year + 1)
For the "get off my lawn" crew:

    $('#year').text(Number($('#year').text()) + 1)