useSupported
Check to see if your browser supports some features
Usage
import { useSupported } from "@reactuses/core";
const Demo = () => {
const isSupported = useSupported(() => "EyeDropper" in window);
return (
<div>
<p>
window.EyeDropper is {isSupported ? "supported" : "unsupported"} in your
browser
</p>
</div>
);
};
Example
window.EyeDropper is unsupported in your browser
Type Declarations
export default function useSupported(
callback: () => unknown,
sync?: boolean
): boolean