mirror of https://gitee.com/antv-l7/antv-l7
fix: l7 react source update 机制
This commit is contained in:
parent
9abd412c80
commit
2954345f3f
|
@ -12,6 +12,6 @@ export default React.memo(function Chart(props: ILayerProps) {
|
|||
const { layer, active } = props;
|
||||
useEffect(() => {
|
||||
layer.active(active.option);
|
||||
}, [active, layer]);
|
||||
}, [JSON.stringify(active)]);
|
||||
return null;
|
||||
});
|
||||
|
|
|
@ -13,6 +13,6 @@ export default React.memo(function Chart(props: ILayerProps) {
|
|||
if (filter.field) {
|
||||
layer.filter(filter.field as string, filter.values as StyleAttrField);
|
||||
}
|
||||
}, [filter.field, JSON.stringify(filter.values), filter.values]);
|
||||
}, [filter.field, JSON.stringify(filter.values)]);
|
||||
return null;
|
||||
});
|
||||
|
|
|
@ -13,6 +13,6 @@ export default React.memo(function Chart(props: ILayerProps) {
|
|||
size.field
|
||||
? layer.size(size.field, size.values)
|
||||
: layer.size(size.values as StyleAttrField);
|
||||
}, [size.field, size.values, size.scale]);
|
||||
}, [size.field, JSON.stringify(size.values), size.scale]);
|
||||
return null;
|
||||
});
|
||||
|
|
|
@ -17,6 +17,6 @@ export default React.memo(function Chart(props: ISourceProps) {
|
|||
} else {
|
||||
layer.setData(data, sourceOption);
|
||||
}
|
||||
}, [data, sourceOption]);
|
||||
}, [data, JSON.stringify(sourceOption)]);
|
||||
return null;
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue