Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

https://github.com/gregnb/use-detect-print

A react hook to detect when a page is being printed
https://github.com/gregnb/use-detect-print

hooks react react-hooks

Last synced: 2 months ago
JSON representation

A react hook to detect when a page is being printed

Lists

README

        

# use-detect-print

React Hook to detect printing

## Installation

```
npm install use-detect-print --save
```

## Usage

```javascript
import React from 'react';
import useDetectPrint from 'use-detect-print';

function App() {

const isPrinting = useDetectPrint();

return (


Is it printing?
{isPrinting ? (
Yes
): (
No!
)}

);
}

```