Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[desk-tool] Clean up pane deriving flow slightly #1000

Merged
merged 1 commit into from
Oct 10, 2018
Merged

Conversation

rexxars
Copy link
Member

@rexxars rexxars commented Oct 9, 2018

We were using shouldComponentUpdate for side effects, which is obviously not pretty.
This changes to using componentWillReceiveProps which isn't really all that much better, but at least it reads better.

In addition, we now prevent re-rendering the desk tool when the pane deriving is about to be performed - this prevents a "phantom" re-render where the keys prop would be updated with the new keys from the URL, but the panes would be left with the old panes. This is very confusing when debugging, so it feels like a step forward.

The real solution here is probably to have the state router be observable in some way, so we may subscribe to changes on it and update the state without relying on being passed new props.

@rexxars rexxars requested a review from bjoerge October 9, 2018 13:18
Copy link
Member

@bjoerge bjoerge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏

@rexxars rexxars merged commit 2ed2362 into next Oct 10, 2018
@rexxars rexxars deleted the cleaner-pane-deriving branch October 10, 2018 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants