Hacker News new | ask | show | jobs
by sebmarkbage 1661 days ago
My work seems to have made you angry which makes me sad.

You’ll at least be happy to learn that useEffect will be sync if the render itself was sync in React 18. Ofc if you do an async render those effects won’t work anyway and you need to do it in the event handler itself.

I doubt it’s much of a conciliation though. I agree the programming model is weird. It’s the best idea we had for what we were trying to achieve. Sorry for the trouble it has caused you.

1 comments

My primary issue is that you guys did have other options. You did. I saw the RFC thread. About 2/3s were useless "oh no" or "oh yes" comments, but about a third had suggestions and feedback, some good feedback, on how to make the stateful function API not as jarring and not as weird. You simply ignored it all, since you already had an API in mind (and perhaps already did most of the work, I don't know)

That you thought (correctly) that an eslint package of rules was necessary to prevent people from shooting themselves in the foot with the gun you have provided should have been a hint that it's not good API.