的 注意 强> :这很可能会在未来发生变化,但在撰写本文时,您可以查看 预取 零件。
Prefetch当时只适用于Panos,但看起来它足以满足您当前的需求。
import {Prefetch} from 'react-vr'; ... ... render() { return ( ... <Prefetch key={someUniqueKey} source={asset(`360/${this.thePanoImage}`)} /> ... ); }
Pano 的 源代码 检查 Prefetch 加载图像时的缓存。所以当你尝试加载时 Pano 对于 this.thePanoImage 接下来,图像应该在缓存中可用,并且不会再次获取。
Pano
Prefetch
this.thePanoImage