r/reactjs • • Apr 30 '26

Discussion Finally realized how much i was abusing useEffect, and deleting them is the best feeling ever..

[removed]

288 Upvotes

85 comments sorted by

View all comments

Show parent comment

1

u/michaelfrieze Apr 30 '26

Yeah, I saw this posted somewhere else in this thread.

I'm surprised the react team hasn't released something like this officially. There must be a reason, right?

2

u/nickjvandyke May 01 '26

When I first posted it here almost a year ago, some people said they tried but gave up haha. It was pretty dang hard. It's stable now but its initial experimentation fits a community plugin better as well.

1

u/michaelfrieze May 01 '26

I used this today and I'm impressed. I let GPT5.5 create a new react project and I knew it would use a ton of useEffect. I then installed this plugin and set it to strict. Then, I let GPT5.5 go through each error in the terminal and fix it. Surprisingly, this worked quite well and GPT5.5 did a pretty good job of writing the correct code to avoid useEffect.

You did pretty well with the error messages.

I'm not sure why people would give up. Are they just annoyed that they should be using something other than useEffect or was it just not stable then?

I don't understand why the react team hasn't built this yet. Their hooks plugin is so helpful, why not use it for the useEffect as well? I know the react team complains about useEffect all the time and have even said they wish it never would have been publicly released.

When people talk about react footguns, it's almost always useEffect related. A plugin like this makes a ton of sense to me.

2

u/nickjvandyke May 02 '26

Thank you!

Sorry my wording was ambiguous - the React team supposedly gave up on writing these rules because it was too hard and/or too unstable for an official plugin

2

u/michaelfrieze May 02 '26 edited May 04 '26

Oh, that makes sense.

So far, it seems like you managed to pull it off. I will have to use it for a while longer to know for sure but I like it.

1

u/michaelfrieze Apr 30 '26

I'm definitely going to try this tomorrow.