New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

react-trap

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-trap

Detect dom events inside or outside an element

latest
Source
npmnpm
Version
1.1.0
Version published
Maintainers
1
Created
Source

react-trap

Detect dom events inside or outside an element

NPM JavaScript Style Guide

Live Demo, playground & DOCS

Install

npm install --save react-trap

Usage

import React from 'react'
import Trap from 'react-trap'

class App extends React.Component {
  render () {
    return (
      <Trap event="click">
        {
          (trapped, ref) => (
            <div ref={ref}>
              {trapped ? "I'm focused" : "I'm out of focus"}
            </div>
          )
        }
      </Trap>
    )
  }
}

License

MIT © sag1v

Keywords

outside-click

FAQs

Package last updated on 20 Oct 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts