DEV Community

Discussion on: Are you using React ? Then I think you must know this

Collapse
 
lexlohr profile image
Alex Lohr

I wrote something that relates to your article: dev.to/lexlohr/react-hooks-tripwir...

Anyways; useMemo in your example will not help at all; the fiber that holds the component will only rerender when its props changes, same as useMemo. An example where it would actually help: if you had a callback that had to be created dynamically inside your component or whatever you used inside there was computation-heavy.

Also, for ajax requests, you need no redux nor thunks. The second last example of my post shows how to do it in an effect.