New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details → →
Socket
Book a DemoSign in
Socket

react-fast-image

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-fast-image

đźš© FastImage, performant React image component.

latest
Source
npmnpm
Version
0.0.30
Version published
Maintainers
1
Created
Source

react-fast-image

Early stages performant React image component.

I'm not sure the API will be similar to React Native Fast Image, but I didn't want to think up another name.

If this goes well I might merge the projects.

Features

  • Lazy loading.
  • Async decoding.
    • Uses img.decode() to decode images before adding them to the DOM.
  • Supports HTML5 video GIFS.
  • Works for users with JS disabled. When SSR is used media is rendered inside <noscript>.
  • Uses padding to reserve space before media is loaded. This reduces UI jank.

Async Decoding

This is very important to prevent frame drops.

Imagine this scenario:

  • A user is scrolling down a page.
  • As they scroll an image loads in (lazy loading).
  • At that time the image is decoded on the main thread.
  • This causes a frame drop, which makes scrolling unpleasant.
  • This looks even worse if there is supposed to be an enter animation on the image.

To prevent this FastImage does decoding of images off the main thread on browsers that support it.

TypeScript

If you're building up props to pass into FastImage you can use FastImageBestProps, FastImageImageBestProps, and FastImageVideoBestProps. Those types mark all the best practice props as required which will help you make sure you don't forget any of them.

Usage

npm install react-fast-image
# or
yarn add react-fast-image

License

MIT

Keywords

react

FAQs

Package last updated on 31 Aug 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts