react-web-vitals

1.0.1 • Public • Published

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:

Option Description Default
enabled Enable reporting. process.env.NODE_ENV !== 'production'
reporter A custom reporter. See code.

Build setup

# Run tests 
yarn run test
 
# Run linting checks 
yarn run lint

Readme

Keywords

none

Package Sidebar

Install

npm i react-web-vitals

Weekly Downloads

17

Version

1.0.1

License

MIT

Unpacked Size

8.44 kB

Total Files

14

Last publish

Collaborators

  • alexmendes