loading...

re: Compute values on component mount with React Hooks: State vs Ref VIEW POST

TOP OF THREAD FULL DISCUSSION
re: One extra improvement, move computevalue() definition outside of the function component to avoid re-defining the function on each cycle.
 

Good point, the idea was always that computeValue() was something imported from somewhere else but I didn't make that clear in my minimal examples. I will update it.

Thanks!

code of conduct - report abuse