Skip to content
React Hook to determine if WebP is supported in the current environment
TypeScript JavaScript
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.dependabot
.github/workflows
src
.gitignore
LICENSE
README.md
jest.config.js
package-lock.json
package.json
stryker.conf.js
tsconfig.json

README.md

react-use-webp-support-check

React Hook to determine if WebP is supported in the current environment

Installation

npm install react-use-webp-support-check

Usage

import React from "react";
import { useWebPSupportCheck } from "react-use-webp-support-check";

export default () => {
  const supportsWebP = useWebPSupportCheck();

  return (
    <div>
      {supportsWebP ? (
        <span>WebP is supported!</span>
      ) : (
        <span>WebP is not supported</span>
      )}
    </div>
  );
};

License

Copyright 2019 Kepler Sticka-Jones. Licensed MIT.

You can’t perform that action at this time.