logoalt Hacker News

ordu • today at 8:30 AM • 0 replies • view on HN

Why? () is an empty type, it is used here twice because... well it is a hello-world example, they don't need any state to render, but API expects you to pass a reference to a state, so they use &() and _ as a placeholder for an arg name. And Widget gets () as a type parameter for the same reason.

Pretty straightforward to my mind.