HomePhabricator
Diffusion Comm 5da4d64aea25

RN0.63 6/16: Fix updating components from function body

Description

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:

  1. detectUnsupervisedBackgroundRef gets called from the Socket constructor, which triggers a setState for Root
  2. 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

Details

Provenance
Ashoat Tevosyan <ashoat@gmail.com>Authored on Oct 26 2020, 6:00 PM
Differential Revision
Restricted Differential Revision
Parents
rCOMMe14efa240279: RN0.63 5/16: Android updates
Branches
Unknown
Tags
Unknown