Use UNSAFE_componentWillReceiveProps in BlobPage.tsx
Created by: lguychard
Fixes #5575 (closed)
The switch to componentDidUpdate()
in the eslint refactor introduced a bug whereby invalid props could be passed down to Blob.tsx
, with AbsoluteRepoFile
props being out of sync with the file content.
Blob.tsx
would then call addModel()
with the out-of-sync data and. Upon receiving the correct file content, the invalid state would remain since a model with the given URI already existed.
This fixes the bug topically by reverting to using UNSAFE_componentWillReceiveProps
. As a follow-up, we should look into simplifying the complex update logic in BlobPage.tsx
and Blob.tsx
.