react2-lighthouse-viewer
TypeScript icon, indicating that this package has built-in type declarations

0.1.241 • Public • Published

react2-lighthouse-viewer

This component is a React wrapper for the lighthouse-viewer. It depends on lighthouse-viewer, package that exports the original lighthouse-viewer from Google as an ES modules package.

Getting started

  1. Install using npm install react2-lighthouse-viewer or yarn add react2-lighthouse-viewer
  2. Import in your project:
import React2LighthouseViewer from "react2-lighthouse-viewer";
  1. Load the component in your code as follows:
<div id="app">
  <React2LighthouseViewer json={json} />
</div>
  1. That's all!

You can also refer to the examples in the examples folder.

  1. Create React App example
  2. Next.js example. The report can not be rendered on the server side due to how the original lighthouse code is implemented.

Package Sidebar

Install

npm i react2-lighthouse-viewer

Weekly Downloads

57

Version

0.1.241

License

Apache-2.0

Unpacked Size

407 kB

Total Files

6

Last publish

Collaborators

  • dvelasquez