Bats plus React useMemo
This example demonstrates how React’s `useMemo` hook caches expensive computations, affecting performance when a counter increments. It displays a number `I` that increases on button click, alongside calculated prime numbers and the time taken to compute them. The code uses `React.useState` and `React.useMemo` within a functional component, and a custom `doPointlessComputationsWithBlocking` function from intensive.js performs blocking prime-number calculations. The `useMemo` dependency array is empty, so the heavy computation runs once on initial render, highlighting how memoization prevents repeated work during subsequent state updates.