Hi,
TSharedRef
cannot be null,never. Therefore you must initialize it at least with empty value in regular class constructor.
So if you add to your class constructor that looks like this:
SMainMenuWidget() : menuStyle(new FSlateStyleSet(FName()))
{}
You should be ready to go. For more on shared references and pointers check out the documentation
Cheers