This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { Component } from 'react'; | |
| class ClickOutside extends Component { | |
| handleClick = e => { | |
| console.log('clicking everywhere!'); | |
| }; | |
| componentDidMount() { | |
| document.addEventListener("click", this.handleClick); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { Component } from 'react'; | |
| class ClickOutside extends Component { | |
| handleClick = e => { | |
| console.log('clicking everywhere!'); | |
| }; | |
| componentDidMount() { | |
| document.addEventListener("click", this.handleClick); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { Component } from 'React'; | |
| import PropTypes from 'prop-types'; | |
| class ClickOutside extends Component { | |
| static propTypes = { | |
| onClick: PropTypes.func | |
| } | |
| constructor(props) { | |
| super(props); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { Component } from 'React'; | |
| import PropTypes from 'prop-types'; | |
| class ClickOutside extends Component { | |
| static propTypes = { | |
| onClick: PropTypes.func | |
| } | |
| constructor(props) { | |
| super(props); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'react'; | |
| function ClickOutside({ children, onClick }) { | |
| const refs = React.Children.map(children, () => React.createRef()); | |
| const handleClick = e => { | |
| const isOutside = refs.every(ref => { | |
| return !ref.current.contains(e.target); | |
| }); | |
| if (isOutside) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { Component, useEffect } from "react"; | |
| function ClickOutside({ children, onClick }) { | |
| const refs = React.Children.map(children, () => React.createRef()); | |
| const handleClick = e => { | |
| const isOutside = refs.every(ref => { | |
| return !ref.current.contains(e.target); | |
| }); | |
| if (isOutside) { | |
| onClick(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { Component, useEffect, useCallback } from "react"; | |
| function ClickOutsideH({ children, onClick }) { | |
| const refs = React.Children.map(children, () => React.createRef()); | |
| const handleClick = useCallback(e => { | |
| const isOutside = refs.every(ref => { | |
| return !ref.current.contains(e.target); | |
| }); | |
| if (isOutside) { | |
| onClick(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export default [ | |
| { | |
| id: 54590991, | |
| node_id: "MDEwOlJlcG9zaXRvcnk1NDU5MDk5MQ==", | |
| name: "cluj", | |
| full_name: "jsheroes/cluj", | |
| private: false, | |
| owner: { | |
| login: "jsheroes", | |
| id: 16759725, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <meta charset='utf-8'> | |
| <span style=" | |
| color: rgb(0, 0, 0); | |
| font-family: Times; | |
| font-size: medium; | |
| font-style: normal; | |
| font-variant-ligatures: normal; | |
| font-variant-caps: normal; | |
| font-weight: 400; | |
| letter-spacing: normal; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <span style=" | |
| font-family: -webkit-standard; | |
| font-style: normal; | |
| font-variant-caps: normal; | |
| font-weight: normal; | |
| letter-spacing: normal; | |
| orphans: auto; | |
| text-align: start; | |
| text-indent: 0px; | |
| text-transform: none; |