You should use react-trap with better options and flexibility
You can pass it a render-prop
or children as function
(more details).
import React, { Component } from 'react';
import ExternalClick from 'ExternalClick';
class App extends Component {
render() {
return (
<div>
<ExternalClick render={Item} />
<ExternalClick>
{isExternalClick => (<Menu show={!isExternalClick} />)}
</ExternalClick>
</div>
);
}
}