This fixes a common React warning we see. Most of these components should be using constructors instead, however componentDidMount is just as good (and doesn't require converting most of these).
Conversion to classes will be done in a later stage of React warning fixes.
For https://github.com/vector-im/riot-web/issues/12877
See https://github.com/vector-im/riot-web/pull/9957
The two hacks introduced here are for different reasons, mostly related to the welcome page. If you land directly on the welcome page, the app's lifecycle is highly unlikely to have a bootstrapped client. This results in the loggedIn class being false. When the client is later set up (loaded from session, new guest account registered, etc) the context fails to update for the EmbeddedPage, and we need to give it a kick to re-render. It's arguable if we should even keep using the context here.