Currently LanguageSelector is cleared by accessing a method of a child component directly from the parent using ref. We should be able to find a better way to clear this field.
Related patch:
https://gerrit.wikimedia.org/r/c/mediawiki/extensions/WikiLambda/+/819575