"Functions with no return values" do exist in JavaScript; you can find them by reading the documentation. When you get back a setter from useState in React, the documentation has this to say. It doesn't provide any guarantees that it's 'undefined' or any other value with any meaning whatsoever:
6 likes 0 replies
?