It is some pseudo DSL with hidden hard to reason mutable state.
let result; for (const item of items) { result = await foo(item); if (result) { break; } }
The same is true of hooks. The code is not stateless, but you can write it very close to the mental model of stateless programming.
That is why -- despite them being optional -- hooks have become incredibly popular.
The same is true of hooks. The code is not stateless, but you can write it very close to the mental model of stateless programming.
That is why -- despite them being optional -- hooks have become incredibly popular.