Skip to content

Refactor D3Component#1

Merged
WilliamHarvey97 merged 2 commits intomasterfrom
refactor-d3-component
Jun 21, 2020
Merged

Refactor D3Component#1
WilliamHarvey97 merged 2 commits intomasterfrom
refactor-d3-component

Conversation

@abelfodil
Copy link
Copy Markdown
Contributor

No description provided.

@abelfodil abelfodil force-pushed the refactor-d3-component branch from 9e4d222 to 3755468 Compare June 18, 2020 23:33
static propTypes = {
callback: PropTypes.func.isRequired,
}
const D3Component = React.memo(({ callback }) => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Use React.memo so we don't rerender when the parent does rerender with that same callback prop. We want that since D3 will handle DOM updates inside this svg.

@WilliamHarvey97 WilliamHarvey97 merged commit 708d3d9 into master Jun 21, 2020
@WilliamHarvey97 WilliamHarvey97 deleted the refactor-d3-component branch July 20, 2020 01:55
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.

2 participants