If you're working with a variable in a memoized function, don't forget to include it as a dependency. Forgetting to do so and leaving the dependency array empty will result in the function not being re-created and the value won't update.
Count: 1