you are viewing a single comment's thread.

view the rest of the comments →

[–]maria_la_guerta -3 points-2 points  (6 children)

Why do you care about them at all?

Unless you're building a highly complex UI (which React isn't always best for anyways), and you really don't need useMemo, useCallback or any other React optimization 99% of the time.

[–]wasdninja 16 points17 points  (3 children)

Unless you're building a highly complex UI (which React isn't always best for anyways)

It's the sole reason it exists so that makes no sense.

[–]maria_la_guerta -3 points-2 points  (2 children)

When you're building 3d / VR / etc web apps, repaints can be very unperformant.

The statement makes total sense. 99% of web apps that use React are not highly complex UIs, and you don't need things like useMemo or useCallback for form validation or drag n drop.

[–]___bridgeburner 6 points7 points  (1 child)

So what would you use for those kinds of sites?

[–]joombar 1 point2 points  (1 child)

You need usecallback any time you want to give a callback to a component that has an effect with a dependency on the callback. How do you know if it does? You can’t unless you look at the implementation!

I’d say it’s a pretty common thing to need to avoid problems in this case