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: about 2 months ago
JSON representation
A react hook to detect when a page is being printed
- Host: GitHub
- URL: https://github.com/gregnb/use-detect-print
- Owner: gregnb
- Created: 2019-02-13T05:00:45.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-03T16:25:33.000Z (almost 2 years ago)
- Last Synced: 2024-10-16T01:21:14.854Z (about 2 months ago)
- Topics: hooks, react, react-hooks
- Language: JavaScript
- Homepage:
- Size: 921 KB
- Stars: 59
- Watchers: 2
- Forks: 2
- Open Issues: 32
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- fucking-awesome-react-hooks - `use-detect-print`
- awesome-react-hooks-cn - `use-detect-print`
- awesome-react-hooks - `use-detect-print`
- awesome-react-hooks - `use-detect-print`
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!
)}
);
}```