3 ms·
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?
by flippinburgers 4y ago
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?
- satvikpendem 4y ago> 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.
- acover 4y agoSpecifically a component can mount and unmount at strange times. If you expect use effect to only run once you may run into problems.
- flippinburgers 4y agoYou 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.