Skip to content

Commit

Permalink
fix: fix config comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
kagawagao committed Apr 1, 2020
1 parent b6ebedd commit 31fdc85
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
5 changes: 4 additions & 1 deletion __tests__/plots/line.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ describe('LineChart', () => {

ReactDOM.render(<LineChart data={[{ x: 1 }]} forceFit />, div)

ReactDOM.render(<LineChart data={[]} forceFit={false} />, div)
ReactDOM.render(
<LineChart data={[]} forceFit xAxis={{ visible: true }} />,
div
)

ReactDOM.unmountComponentAtNode(div)
})
Expand Down
7 changes: 3 additions & 4 deletions src/plots/base.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,10 @@ export default class BaseChart<
componentDidUpdate() {
const config = this.getConfig(this.props)
const { data, ...restConfig } = config as any
const thisFnKeys = getFnKeys(config)
const restFnKeys = getFnKeys(restConfig)
const fnKeys = getFnKeys(restConfig)
const isConfigChanged = !isEqual(
omit(this.config, thisFnKeys),
omit(restConfig, restFnKeys)
omit(this.config, fnKeys),
omit(restConfig, fnKeys)
)
/* istanbul ignore else */
if (this.chart) {
Expand Down

0 comments on commit 31fdc85

Please sign in to comment.