We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
发现很多地方都推荐直接在 html 中通过 script 外链加载,或者在应用入口 import appear-polyfill
appear-polyfill
如果客户端已经原生支持 IntersectionObserver,这个包也会额外载入 IntersectionObserver.js(22 kB not minified)
因为需要懒加载的图片对于首屏呈现都不是阻塞的,但是为了懒加载这部分图片,却需要同步地加载这个包,这点感觉不太合理
在我自己的一个工程里已经实现了延迟加载 appear-polyfill,可以将 appear-polyfill 从主包分割出去,而且会在 useEffect 里执行(不会阻塞首屏渲染),如果客户端原生支持 IntersectionObserver,也不会再引入额外的 polyfill 代码
用法类似
import useAppear from 'use-appear' export default () => { useAppear(); }
晚点看看是不是可以提个 PR
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
发现很多地方都推荐直接在 html 中通过 script 外链加载,或者在应用入口 import
appear-polyfill
如果客户端已经原生支持 IntersectionObserver,这个包也会额外载入 IntersectionObserver.js(22 kB not minified)
因为需要懒加载的图片对于首屏呈现都不是阻塞的,但是为了懒加载这部分图片,却需要同步地加载这个包,这点感觉不太合理
在我自己的一个工程里已经实现了延迟加载 appear-polyfill,可以将 appear-polyfill 从主包分割出去,而且会在 useEffect 里执行(不会阻塞首屏渲染),如果客户端原生支持 IntersectionObserver,也不会再引入额外的 polyfill 代码
用法类似
晚点看看是不是可以提个 PR
The text was updated successfully, but these errors were encountered: