useEffect(() => {
setImage(
<ImageComponent
{...props}
style={[props.style, {
width: scalableWidth,
height: scalableHeight
}]}
/>
);
}, [scalableHeight, scalableWidth]);
useEffect(() => {
const {style, ...restProps} = props;
setImage(
<ImageComponent
{...restProps}
style={[style, {
width: scalableWidth,
height: scalableHeight
}]}
/>
);
}, [scalableHeight, scalableWidth]);
should be refactored to