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

fix: Graph fails to render without config prop #84

Merged
merged 1 commit into from Jul 2, 2018

Conversation

@LonelyPrincess
Copy link
Collaborator

LonelyPrincess commented Jul 1, 2018

When the user didn't add the 'config' prop to the 'Graph' component (which should be possible, as it's an optional field), the graph failed to render whenever its data changed.

The component would work the first time around, but when it received new data, it threw an error as described in this issue and the view would not update.

The root of the problem was located in the componentWillReceiveProps method of the Graph component. When defining the constants configUpdated and transform, the case in which newProps.config was set to either null or undefined was not being considered. This caused errors when calling isDeepEqual and also when trying to get the panAndZoom property during transform initialization.

When the user didn't add the 'config' prop to the 'Graph' component (which should be possible, as it's an optional field), the graph failed to render whenever its data changed.

The component would work the first time around, but when it received new data, it threw an error as described [in this issue](#81) and the view would not update.

The root of the problem was located in the `componentWillReceiveProps` method of the `Graph` component. When defining the constants `configUpdated` and `transform`, the case in which `newProps.config` was set to either null or undefined was not being considered. This caused errors when calling `isDeepEqual` and also when trying to get the `panAndZoom` property during `transform` initialization.
@danielcaldas

This comment has been minimized.

Copy link
Owner

danielcaldas commented Jul 2, 2018

With this, we close #81, good stuff @LonelyPrincess

@danielcaldas danielcaldas merged commit 95a9ebb into danielcaldas:master Jul 2, 2018
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@LonelyPrincess LonelyPrincess deleted the LonelyPrincess:fix_null_config branch Sep 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.