Skip to content

Instantly share code, notes, and snippets.

@abenoit
Last active April 3, 2019 04:51
Show Gist options
  • Save abenoit/1f66d67970fcdda0c2b06a7d76ab2484 to your computer and use it in GitHub Desktop.
Save abenoit/1f66d67970fcdda0c2b06a7d76ab2484 to your computer and use it in GitHub Desktop.
ReasonML Binding for react-click-outside
[@bs.module "react-click-outside"]
external clickOutside: ReasonReact.reactClass = "default";
[@bs.deriving abstract]
type jsProps = {
className: option(string),
onClickOutside: ReactEvent.Mouse.t => unit,
};
let make = (~className=?, ~onClickOutside, children) =>
ReasonReact.wrapJsForReason(
~reactClass=clickOutside,
~props=jsProps(~className, ~onClickOutside),
children,
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment