Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions showcase/examples/force-directed-graph/force-directed-graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,12 @@ class ForceDirectedGraph extends React.Component {
};
}

componentWillReceiveProps(nextProps) {
this.setState({
data: generateSimulation(nextProps)
});
componentDidUpdate(prevProps, prevState, snapshot) {

Choose a reason for hiding this comment

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

why snapshot parameter is declared if it's not used inside componentDidUpdate. Remove unused parameters.

if (this.props !== prevProps) {
this.setState({
data: generateSimulation(this.props)
});
}
}

render() {
Expand Down
19 changes: 10 additions & 9 deletions showcase/examples/responsive-vis/responsive-scatterplot.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,16 @@ export default class ResponsiveScatterplot extends React.Component {
selectedPoints: []
};

componentWillReceiveProps(nextProps) {
// not the greatest
this.setState({
binData: transformToBinData(
nextProps.data,
nextProps.width,
nextProps.height
)
});
componentDidUpdate(prevProps, prevState, snapshot) {

Choose a reason for hiding this comment

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

Remove unused parameters.

if (this.props !== prevProps) {
this.setState({
binData: transformToBinData(
this.props.data,
this.props.width,
this.props.height
)
});
}
}

getFeatures() {
Expand Down
Loading