Skip to content

Instantly share code, notes, and snippets.

@SllyQ
Created November 14, 2017 11:27
Show Gist options
  • Save SllyQ/a787b7df58a6e1395c2a84be88753ecb to your computer and use it in GitHub Desktop.
Save SllyQ/a787b7df58a6e1395c2a84be88753ecb to your computer and use it in GitHub Desktop.
open ExtUtils;
module DragDropContext = {
[@bs.module "react-beautiful-dnd"] external reactClass : ReasonReact.reactClass =
"DragDropContext";
Js.log(reactClass);
let make = (~onDragEnd, children) =>
ReasonReact.wrapJsForReason(~reactClass, ~props={"onDragEnd": onDragEnd}, children);
};
module Draggable = {
[@bs.module "react-beautiful-dnd"] external reactClass : ReasonReact.reactClass = "Draggable";
let make = (~draggableId, ~render, _) =>
ReasonReact.wrapJsForReason(
~reactClass,
~props={
"draggableId": draggableId
},
Obj.magic(render)
);
};
module Droppable = {
[@bs.module "react-beautiful-dnd"] external reactClass : ReasonReact.reactClass = "Droppable";
let make = (~render, ~droppableId, ~isDropDisabled=?, _) =>
ReasonReact.wrapJsForReason(
~reactClass,
~props={
"droppableId": droppableId,
"isDropDisabled": isDropDisabled |> jsOptBool |> Js.Nullable.from_opt
},
Obj.magic(render)
);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment