JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 9
  • Score
    100M100P100Q39649F
  • License MIT

A react hook to an event listener to the document object

Package Exports

  • @rooks/use-document-event-listener

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@rooks/use-document-event-listener) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@rooks/use-document-event-listener

TitleCard

Build Status

About

A react hook to an event listener to the document object

Installation

npm install --save @rooks/use-document-event-listener

Importing the hook

import useDocumentEventListener from "@rooks/use-document-event-listener"

Usage

function Demo() {
  useDocumentEventListener("click", function(){
    console.log("clicked")
  });
  return null
}

render(<Demo/>)