diff --git a/superset-frontend/src/explore/components/ExploreChartPanel.jsx b/superset-frontend/src/explore/components/ExploreChartPanel.jsx
index 2fd0338c56e95..f0ea90694a6e4 100644
--- a/superset-frontend/src/explore/components/ExploreChartPanel.jsx
+++ b/superset-frontend/src/explore/components/ExploreChartPanel.jsx
@@ -203,6 +203,11 @@ const ExploreChartPanel = props => {
[chartRef, renderChart],
);
+ const standaloneChartBody = useMemo(
+ () =>
{renderChart()}
,
+ [chartRef, renderChart],
+ );
+
if (props.standalone) {
// dom manipulation hack to get rid of the boostrap theme's body background
const standaloneClass = 'background-transparent';
@@ -210,7 +215,7 @@ const ExploreChartPanel = props => {
if (!bodyClasses.includes(standaloneClass)) {
document.body.className += ` ${standaloneClass}`;
}
- return renderChart();
+ return standaloneChartBody;
}
const header = (
diff --git a/superset/charts/api.py b/superset/charts/api.py
index dbf37d881ebf8..6f2d380a7a201 100644
--- a/superset/charts/api.py
+++ b/superset/charts/api.py
@@ -557,7 +557,7 @@ def data(self) -> Response:
try:
json_body = json.loads(request.form["form_data"])
except (TypeError, json.JSONDecodeError):
- json_body = None
+ pass
if json_body is None:
return self.response_400(message=_("Request is not JSON"))