react-use-webp-support-check
TypeScript icon, indicating that this package has built-in type declarations

1.0.21 • Public • Published

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.

/react-use-webp-support-check/

    Package Sidebar

    Install

    npm i react-use-webp-support-check

    Weekly Downloads

    54

    Version

    1.0.21

    License

    MIT

    Unpacked Size

    18.1 kB

    Total Files

    24

    Last publish

    Collaborators

    • keplersj