react2-lighthouse-viewer
v0.1.241
Published
This component is a React wrapper for the lighthouse-viewer. It depends on [lighthouse-viewer](../lighthouse-viewer), package that exports the original lighthouse-viewer from Google as an ES modules package.
Downloads
679
Maintainers
Readme
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
- Install using
npm install react2-lighthouse-viewer
oryarn add react2-lighthouse-viewer
- Import in your project:
import React2LighthouseViewer from "react2-lighthouse-viewer";
- Load the component in your code as follows:
<div id="app">
<React2LighthouseViewer json={json} />
</div>
- That's all!
You can also refer to the examples in the examples folder.
- Create React App example
- Next.js example. The report can not be rendered on the server side due to how the original lighthouse code is implemented.