Prepare the custard ahead of time so it has plenty of time to chill before filling the donuts.
In a medium bowl, whisk together the egg yolks and cornstarch until completely smooth. Set aside.
In a medium saucepan over medium heat, combine the milk, sugar, and salt. Whisk frequently and heat until the mixture is steaming but not boiling.
Scoop out about 1 cup (240 g) of the hot milk mixture and slowly drizzle it into the egg mixture while whisking constantly. This tempers the eggs and prevents scrambling.
Gradually pour the tempered egg mixture back into the saucepan with the remaining milk, whisking continuously.
Cook over medium heat, whisking constantly, for 3–5 minutes or until the custard becomes thick and smooth.
Remove from the heat and stir in the vanilla extract.
Transfer the custard to a clean bowl and press plastic wrap directly onto the surface to prevent a skin from forming. Refrigerate for at least 2 hours or until completely chilled.