useSupported

A React Hook that helps to check if browser supports a feature in both client and Server-side Rendering (SSR).

Demo

Source
EyeDropper Supported:
false

Usage

See API for more details.

Source

Click links below to view source on GitHub.

API

const isSupported = useSupported(callback, deps)

Callback

A function whose return value is converted to a Boolean value to check whether the feature is supported.

Deps

React.DependencyList, An array of dependencies to re-run the check when the value changes.

Returns

A boolean value that indicates if the feature is supported.