Page MenuHomePhabricator

Fix state update error in ConfigEditorModePicker
ClosedPublic

Authored by sashank on Aug 15 2019, 7:00 PM.

Details

Reviewers
bengotow
prha
Group Reviewers
Restricted Project
Commits
R1:f36570706610: Fix state update error in ConfigEditorModePicker
Summary

Previously, the ConfigEditorModePicker component was throwing the following errors, since onModeChange was being called in the render method, and onModeChange called setState.

This diff moves the onModeChange call to the componentDidMount and componentDidUpdate lifecycle methods to fix the error.

Test Plan

Loaded dagit, switched pipelines, error was not thrown and mode picker behaved as expected

Diff Detail

Repository
R1 dagster
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

sashank created this revision.Aug 15 2019, 7:00 PM
sashank edited the summary of this revision. (Show Details)Aug 15 2019, 7:00 PM
prha accepted this revision.Aug 15 2019, 8:23 PM
prha added a subscriber: prha.

LGTM

This revision is now accepted and ready to land.Aug 15 2019, 8:23 PM