From 40323decef7344cc558a0b2a6f7846f00fd41793 Mon Sep 17 00:00:00 2001 From: Nakul Nagargade <133095394+nakulnagargade@users.noreply.github.com> Date: Tue, 17 Oct 2023 13:36:00 +0530 Subject: [PATCH] Fix state not changing in chart (#7900) * Fix in chart, toggles are not working * Update Chart.jsx --------- Co-authored-by: Arpit --- frontend/src/Editor/Inspector/Components/Chart.jsx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/frontend/src/Editor/Inspector/Components/Chart.jsx b/frontend/src/Editor/Inspector/Components/Chart.jsx index 4c2c20c890..88e55d1e01 100644 --- a/frontend/src/Editor/Inspector/Components/Chart.jsx +++ b/frontend/src/Editor/Inspector/Components/Chart.jsx @@ -56,17 +56,16 @@ class Chart extends React.Component { } render() { - const { dataQueries, component, paramUpdated, componentMeta, components, currentState } = this.state; - const data = this.state.component.component.definition.properties.data; + const { dataQueries, component, paramUpdated, componentMeta, components, currentState } = this.props; + const data = this.props.component.component.definition.properties.data; // since component is not unmounting on every render in current scenario - const jsonDescription = this.state.component.component.definition.properties.jsonDescription; + const jsonDescription = this.props.component.component.definition.properties.jsonDescription; const plotFromJson = resolveReferences( - this.state.component.component.definition.properties.plotFromJson?.value, + this.props.component.component.definition.properties.plotFromJson?.value, currentState ); - - const chartType = this.state.component.component.definition.properties.type.value; + const chartType = this.props.component.component.definition.properties.type.value; let items = [];