I've just encountered this use case where I want to modify the
lang attribute when language is switched by the user.
React Helmet made this quite simple actually.
Just get the lang from your react state and pass it to the Helmet component anywhere in your app:
// with this.state = { lang : 'en' }