CodeSOD: Coerce the Truth Out of You (opens in new tab)
Frank suspected something odd when he spotted a use of React's useMemo function in some JavaScript code. Now, there's nothing wrong with using that method, in and of itself. It watches some variables and recalculates a callback if they change for any reason. It's a great tool for when you want to avoid recalculating expensive things over and over again. But in this case, the calculation in question was isAuthorized, which wasn't an expensive calculation; it was just checking if certain values...
Read the original article