mirror of https://gitee.com/antv-l7/antv-l7
fix(react): 地图颜色大小的回调函数不会更新bug
This commit is contained in:
parent
2b9be52cfd
commit
2686c48881
|
@ -13,7 +13,8 @@ export default React.memo(function Chart(props: ILayerProps) {
|
|||
color.field
|
||||
? layer.color(color.field as StyleAttrField, color.values)
|
||||
: layer.color(color.values as StyleAttrField);
|
||||
}, [color.field, color.scale, JSON.stringify(color.values)]);
|
||||
// TODO:目前这种处理会频繁更新,但是直接JSON.Stringify(size.values),回调函数不会更新,待优化
|
||||
}, [color.field, color.scale, color.values]);
|
||||
|
||||
return null;
|
||||
});
|
||||
|
|
|
@ -13,6 +13,7 @@ export default React.memo(function Chart(props: ILayerProps) {
|
|||
size.field
|
||||
? layer.size(size.field, size.values)
|
||||
: layer.size(size.values as StyleAttrField);
|
||||
}, [size.field, JSON.stringify(size.values), size.scale]);
|
||||
// TODO:目前这种处理会频繁更新,但是直接JSON.Stringify(size.values),回调函数不会更新,待优化
|
||||
}, [size.field, size.values, size.scale]);
|
||||
return null;
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue