未验证 提交 0ce28973 编写于 作者: P Peter Pan 提交者: GitHub

fix: unnecessary render of histogram chart axis label (#824)

上级 75634f7a
...@@ -74,6 +74,7 @@ ...@@ -74,6 +74,7 @@
"@babel/preset-env": "7.11.5", "@babel/preset-env": "7.11.5",
"@babel/preset-react": "7.10.4", "@babel/preset-react": "7.10.4",
"@baiducloud/sdk": "1.0.0-rc.22", "@baiducloud/sdk": "1.0.0-rc.22",
"@simbathesailor/use-what-changed": "0.1.25",
"@snowpack/app-scripts-react": "1.10.0", "@snowpack/app-scripts-react": "1.10.0",
"@snowpack/plugin-dotenv": "2.0.1", "@snowpack/plugin-dotenv": "2.0.1",
"@snowpack/plugin-optimize": "0.2.1", "@snowpack/plugin-optimize": "0.2.1",
......
...@@ -146,6 +146,7 @@ export const Wrapper = styled.div` ...@@ -146,6 +146,7 @@ export const Wrapper = styled.div`
export const useChartTheme = (gl?: boolean) => { export const useChartTheme = (gl?: boolean) => {
const theme = useTheme(); const theme = useTheme();
const tt = useMemo(() => themes[theme], [theme]); const tt = useMemo(() => themes[theme], [theme]);
const result = useMemo(() => {
if (gl) { if (gl) {
return { return {
title: { title: {
...@@ -266,4 +267,6 @@ export const useChartTheme = (gl?: boolean) => { ...@@ -266,4 +267,6 @@ export const useChartTheme = (gl?: boolean) => {
} }
} }
}; };
}, [tt, gl]);
return result;
}; };
...@@ -2549,6 +2549,11 @@ ...@@ -2549,6 +2549,11 @@
estree-walker "^1.0.1" estree-walker "^1.0.1"
picomatch "^2.2.2" picomatch "^2.2.2"
"@simbathesailor/use-what-changed@0.1.25":
version "0.1.25"
resolved "https://registry.yarnpkg.com/@simbathesailor/use-what-changed/-/use-what-changed-0.1.25.tgz#adf9373fb8d71dd8ab41c7cd789d8dd1fd80a058"
integrity sha512-hBzjQYMaSd/IFiFW3XEs4V+Cjklv65XSvtS1nCCsX07J5PjQWXR52AL+fZfJgw52RvgyrVFVRcT611/UffBmhg==
"@sindresorhus/is@^0.14.0": "@sindresorhus/is@^0.14.0":
version "0.14.0" version "0.14.0"
resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.14.0.tgz#9fb3a3cf3132328151f353de4632e01e52102bea" resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.14.0.tgz#9fb3a3cf3132328151f353de4632e01e52102bea"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册