News for hackers. Stuff that matters.
Re:A Visual Guide to UseEffect by flippinburgers on Monday December 26, 2022 @08:55PM (#34144102)
useEffect is precisely for getting/posting data. That is one of its purposes. If the react team is acting suddenly like it isn't they are ignoring... reality?
Re:A Visual Guide to UseEffect by satvikpendem on Monday December 26, 2022 @09:03PM (#34144151)
> useEffect is precisely for getting/posting data. That is one of its purposes.

Where is this said? Because everything I've read has been that doing any non-idempotent action in an effect will cause bugs. Therefore, GETting data is fine but POSTing it is not. I've read this even before these new beta docs.

Re:A Visual Guide to UseEffect by acover on Monday December 26, 2022 @09:07PM (#34144183)
Specifically a component can mount and unmount at strange times. If you expect use effect to only run once you may run into problems.
Re:A Visual Guide to UseEffect by flippinburgers on Thursday January 05, 2023 @01:17AM (#34256704)
You are right. I messaged too quickly. When I think about the times I've used useEffect it has been to GET data for populating a page (as I recall). It has been a little while since I have done frontend hook dev.