RN0.63 6/16: Fix updating components from function body
Summary:
I noticed a warning in the dev console when I first ran the Android build with React Native 0.63:
Warning: Cannot update a component from inside the function body of a different component.
I noticed this happening in two places:
- detectUnsupervisedBackgroundRef gets called from the Socket constructor, which triggers a setState for Root
- setLinkButton gets called from the ComposeThread constructor, which triggers a setState somewhere in React Navigation
In this diff I move both to componentDidMount.
Test Plan: I amde sure the warnings in the dev console went away
Reviewers: palys-swm
Subscribers: KatPo, zrebcu411, Adrian
Differential Revision: https://phabricator.ashoat.com/D316