1.0.1 • Published 4 years ago

react-web-vitals v1.0.1

Weekly downloads
57
License
MIT
Repository
github
Last release
4 years ago

React Web Vitals

semantic-release npm version

A React hook to print warnings if Web Vitals are above best practice thresholds.

Installation

yarn add react-web-vitals

Usage

Add the following hook to start monitoring web vitals:

import { useWebVitals } from 'react-web-vitals';

useWebVitals();

Settings

The hook accepts an object with the following settings:

OptionDescriptionDefault
enabledEnable reporting.process.env.NODE_ENV !== 'production'
reporterA custom reporter.See code.

Build setup

# Run tests
yarn run test

# Run linting checks
yarn run lint