Hi Edidiong Asikpo, thanks for your question. Yes, the purpose of lazy initial state is to prevent subsequent re-renders of the same expensive function that you only want to run once.
Let's say you want to run this function upon render but just once:
const [state, setState] = useState(getInitialHundredItems())
The way React useState works is that even after you updated the state, the initial state function will get executed and then disregarded (replaced with updated value). So if initial state is an expensive function, it will be waste of processing power. Since all initial states will be disregarded and replaced with updated value (if exist) anyways, lazy initial state ensures that the expensive function runs only once.