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;
|
const { layer, active } = props;
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
layer.active(active.option);
|
layer.active(active.option);
|
||||||
}, [active, layer]);
|
}, [JSON.stringify(active)]);
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
|
|
|
@ -13,6 +13,6 @@ export default React.memo(function Chart(props: ILayerProps) {
|
||||||
if (filter.field) {
|
if (filter.field) {
|
||||||
layer.filter(filter.field as string, filter.values as StyleAttrField);
|
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;
|
return null;
|
||||||
});
|
});
|
||||||
|
|
|
@ -13,6 +13,6 @@ export default React.memo(function Chart(props: ILayerProps) {
|
||||||
size.field
|
size.field
|
||||||
? layer.size(size.field, size.values)
|
? layer.size(size.field, size.values)
|
||||||
: layer.size(size.values as StyleAttrField);
|
: layer.size(size.values as StyleAttrField);
|
||||||
}, [size.field, size.values, size.scale]);
|
}, [size.field, JSON.stringify(size.values), size.scale]);
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
|
|
|
@ -17,6 +17,6 @@ export default React.memo(function Chart(props: ISourceProps) {
|
||||||
} else {
|
} else {
|
||||||
layer.setData(data, sourceOption);
|
layer.setData(data, sourceOption);
|
||||||
}
|
}
|
||||||
}, [data, sourceOption]);
|
}, [data, JSON.stringify(sourceOption)]);
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue