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
Merged

fix: Graph fails to render without config prop #84

merged 1 commit into from
Jul 2, 2018

Conversation

LonelyPrincess
Copy link
Collaborator

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
Copy link
Owner

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

@danielcaldas danielcaldas merged commit 95a9ebb into danielcaldas:master Jul 2, 2018
@LonelyPrincess LonelyPrincess deleted the fix_null_config branch September 20, 2018 12:29
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