Skip to content

Use UNSAFE_componentWillReceiveProps in BlobPage.tsx

Administrator requested to merge fix-incorrect-references into master

Created by: lguychard

Fixes #5575

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.

Merge request reports

Loading