Skip to content

Latest commit

 

History

History
34 lines (25 loc) · 618 Bytes

README.md

File metadata and controls

34 lines (25 loc) · 618 Bytes

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.