mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-12 13:05:41 +03:00
unmounting fix
This commit is contained in:
parent
6066c58d43
commit
70e82e2042
@ -41,11 +41,17 @@ const PostListItemView = ({
|
||||
const [calcImgHeight, setCalcImgHeight] = useState(300);
|
||||
// Component Life Cycles
|
||||
useEffect(() => {
|
||||
let _isMounted = false;
|
||||
if (image) {
|
||||
ImageSize.getSize(image.uri).then((size) => {
|
||||
setCalcImgHeight((size.height / size.width) * dim.width);
|
||||
});
|
||||
if (!_isMounted) {
|
||||
ImageSize.getSize(image.uri).then((size) => {
|
||||
setCalcImgHeight((size.height / size.width) * dim.width);
|
||||
});
|
||||
}
|
||||
}
|
||||
return () => {
|
||||
_isMounted = true;
|
||||
};
|
||||
}, []);
|
||||
// Component Functions
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user