Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-click-out

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-click-out

A react component to handle click out events

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
42
increased by68%
Maintainers
1
Weekly downloads
 
Created
Source

React Click Out

npm

A simple component that triggers a callback function when click out.

Usage

Just import ClickOut component and pass a function callback as onClickOut prop.

Critical change - callback prop renamed to onClickOut

import React, { Component } from 'react';
import ClickOut from 'react-click-out';

class App extends Component {
    state = {
        clickedOut: false
    }

    setClickOutState = () => {
        this.setState({ clickedOut: true });
    }

    render() {
        const {
            state: { clickedOut },
            setClickOutState
        } = this;

        return(
            <div>
                <p style={{ color: clickedOut && 'red' }}>Hello</p>
                <ClickOut onClickOut={setClickOutState}>there!</ClickOut>
            </div>
        );
    }
}

API Reference

propdescriptiondefault
onClickOutclick out callback function-
classNameclassName-
containersets container element tagdiv

Keywords

FAQs

Package last updated on 02 Jul 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc