Prince William and a smiling Kate Middleton attended a special performance of Dear Evan Hansen, held in aid of the Royal Foundation