Actually...this can be a lot simpler. I looked at what we're doing in Gesso for Drupal, and we just have the ID and skiplink href hard-coded to 'main'. There's really no reason this needs to be unique per page or to use the useId hook. It just needs to be a string both the skiplinks and the main container can use. Really, I think all I need here is a constant that the developer can change if they ever want something other than 'main' as the ID.
Actually...this can be a lot simpler. I looked at what we're doing in Gesso for Drupal, and we just have the ID and skiplink href hard-coded to 'main'. There's really no reason this needs to be unique per page or to use the useId hook. It just needs to be a string both the skiplinks and the main container can use. Really, I think all I need here is a constant that the developer can change if they ever want something other than 'main' as the ID.